Proxy questions

Kevin Smith khs4473 at gmail.com
Sun Jan 20 12:38:02 PST 2013


> Before commenting on the general question, I'm confused about
> something in your code. How did a proxy get bound to "this" in your
> example?
>

This is what I was thinking:

    var blackHole = new Purse();

    var blackHole = new Proxy(blackHolePurse, {

        get: function(obj, name) {

            if (name === "somethingInocuous") throw new Error("Up in
smoke!");
            return obj[name];
        }
    });

    blackHole.deposit(1000, myPurse);

It's a pretty silly "attack", obviously : )  Apparently I'm not very good
at being evil.

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130120/ff7b5654/attachment.html>


More information about the es-discuss mailing list