[Harmony Proxies] Default trap implementations should be non-normative

Tom Van Cutsem tomvc.be at gmail.com
Sun Jun 12 06:36:25 PDT 2011


Hi Sean,

I agree that when it comes time to write the ES.next spec language, we
should refactor the existing built-in methods such that it's not actually
necessary to duplicate their implementation for specifying the default
behavior of the fundamental Proxy traps.

The current proxies:semantics page indeed falls back on default behavior as
specified in ECMAScript itself. At the very least, in the actual spec, we
should probably refer to the built-in implementation rather than to the
"meta-circular" behavior. Your [[Trap]] proposal is another good suggestion
to keep in mind.

Whatever refactoring we apply, we should make absolutely sure that the
built-in normative behavior of non-proxy values remains unchanged.

Cheers,
Tom

2011/5/31 Sean Eagan <seaneagan1 at gmail.com>

> Noticed a few other typos in the [[Trap]] steps, here's a better version:
>
> 1.  Let noTrapReturn be a List with the elements false and undefined.
> 2.  If O does not have a [[Handler]] internal property return noTrapReturn.
> 3.  Let handler be the value of the [[Handler]] internal property of O.
> 4.  Let trap be the result of calling the [[Get]] internal method of
> handler with argument Name.
> 5.  If trap is undefined, return noTrapReturn.
> 6.  If IsCallable(trap) is false, then
>   a.  If Throw is true throw a TypeError exception.
>    b.  return noTrapReturn.
> 7. Return a List whose first element is true, and whose second
> element is the result of calling the [[Call]] internal method of trap
> providing handler as the this value and Arguments appended with O as
> the arguments.
>
>
> On Tue, May 31, 2011 at 12:08 PM, Sean Eagan <seaneagan1 at gmail.com> wrote:
> > On Tue, May 31, 2011 at 12:04 PM, Sean Eagan <seaneagan1 at gmail.com>
> wrote:
> >> 1.  If O does not have a [[Handler]] internal property return [false].
> >> 2.  Let handler be the value of the [[Handler]] internal property of O.
> >> 3.  Let trap be the result of calling the [[Get]] internal method of
> >> handler with argument Name.
> >> 4.  If trap is undefined, return a List whose first element is false.
> >> 5.  If IsCallable(trap) is false, then
> >>    a.  If Throw is true throw a TypeError exception.
> >>    b.  return a List whose first element is false.
> >> 7.  Return trap.
> >> 6.  Return a List whose first element is true, and whose second
> >> element is the result of calling the [[Call]] internal method of trap
> >> providing handler as the this value and Arguments appended with O as
> >> the arguments.
> >>
> >
> > Sorry, ignore step 7, forgot to remove it.
> >
> > Thanks,
> > Sean Eagan
> >
>
>
> Thanks,
> Sean Eagan
> _______________________________________________
> 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/20110612/8ea2aa6d/attachment.html>


More information about the es-discuss mailing list