Security Demands Simplicity (was: Private Slots)

Kevin Smith khs4473 at gmail.com
Sun Jan 20 07:49:36 PST 2013


Got it.  And one more (thanks for bearing with me):  what affect does
throwing an error have within a trap?

    var target = {
      foo: function() { this.bar; console.log("after bar"); },
      bar: 0
    };

    var proxy = new Proxy(target, {
      get: function(obj, name) {
        if (name === "bar") throw new Error("boom");
        return obj[name];
      }
    });

    proxy.foo();

Does the stack unwind as with normal error handling?  Does "after bar" get
logged?  (FF18 answers yes to the first and no to the second question.)

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


More information about the es-discuss mailing list