Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The John Resig post linked by TFA indicates that this was originally dealt with by locking the constructor altogether:

   function Array(){
     alert("hello, I found something of yours!");
   }
   // ERROR: redeclaration of const Array
But it appears that the restriction now applies only to literals, as I can do this in at least Chrome and Firefox:

    function Array() {console.log("hope")}
    undefined
    var x = new Array(3);
    hope
    undefined
https://johnresig.com/blog/re-securing-json/


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: