[Proxies] Refactoring prototype climbing in the spec
Andreas Rossberg
rossberg at google.com
Tue Nov 8 07:33:50 PST 2011
On 7 November 2011 16:54, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
> I wrote up an initial (but fairly complete) draft of a proposed refactoring
> of the ES5 [[Get]], [[Put]] and [[HasProperty]] algorithms to change the way
> in which these algorithms climb the prototype
> chain: <http://wiki.ecmascript.org/doku.php?id=strawman:refactoring_put>
Looks good, and as far as I can see from a first read, solves the
issues we were discussing so far.
But I have a follow-up request. :) Regarding redundant trap calls with
proxies there is another, more pervasive problem with the current
spec: in lots of places it first calls [[HasProperty]] and then
[[Get]]. With proxies, this always implies two trap calls, which seems
wasteful. Would it be possible to refactor that, too?
Seems more difficult, because we would need to enable [[Get]] (and
hence the get trap) to signal lookup failure. (Too bad that we cannot
reuse `undefined' for it.) But I think the current situation isn't
satisfactory.
/Andreas
More information about the es-discuss
mailing list