If we ever have the idea to introduce throw-when-trap-is-undefined handlers
bruant.d at gmail.com
Fri Oct 19 07:46:56 PDT 2012
This is just a short note.
In the previous design, some internal proxy operations threw when there was
a missing fundamental trap. We also considered at some point making missing
traps of Handler (previously VirtualHandler)  throw as well (I suggested
to make Object.getPrototypeOf(VirtualHandler.prototype) === Reflect, it's
still in the open issues).
I was playing with ES6 maps and I implemented a proxy wrapper for maps to
make them looks like objects (syntactic sugar) . I wanted all irrelevant
traps to throw. It took about 5-6 lines to define a meta-handler as you'll
see, so maybe it's not worth defining "throw-if-undefined trap" when
another useful (and more complicated to implement) solution can be found.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss