Proxy questions

Tom Van Cutsem tomvc.be at gmail.com
Mon Jan 21 13:47:12 PST 2013


Hi,

I want to stress this again: proxies, for all operations they can
intercept, can always decide to go into an infinite loop or throw.
If they do throw, they can't "hide" their attack from your code. In that
sense they don't violate the code's integrity. The "invariant enforcement"
mechanism is based on the same assumptions: if the proxy detects that the
handler behaves badly, throw to signal the problem.

The alternative to throwing would be for proxies to absorb any exceptions
thrown by traps, but that would be worse (silent failures).

Cheers,
Tom

2013/1/21 Kevin Smith <khs4473 at gmail.com>

> Let me correct a typo in that last one:
>
>     var blackHolePurse = new Purse();
>
>     var blackHole = new Proxy(blackHolePurse, {
>
>         get: function(obj, name) {
>
>             if (name === "somethingInocuous") throw new Error("Up in
> smoke!");
>             return obj[name];
>         }
>     });
>
>     try { blackHole.deposit(1000, myPurse); }
>     catch (x) { /* Oops - $1000 just disappeared from existence. */ }
>
> Again - more foolish than evil.  : )
>
> { Kevin }
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130121/96947d05/attachment.html>


More information about the es-discuss mailing list