Status: Accepted
Owner: [email protected]
Labels: Type-Bug Priority-Medium
New issue 1517 by [email protected]: DISABLED TEST: regress-1119 +
strangeness in getters/setters
http://code.google.com/p/v8/issues/detail?id=1517
This test expects that in the code:
__proto__.__defineSetter_("x", function() { hasBeenInvoked = true; });
eval("try { } catch (e) { var x = false; }");
the setter in the global object's prototype will get invoked. With
bleeding_edge r8496 this is no longer the case.
By my reading of ECMA-262 5th ed. the setter should not be invoked, the
declaration "var x" should be ignored and the assignment is never performed
because the catch body is not reached. Specifically, the
VariableEnvironment is the Global Environment, and at step 10.5.8.b the
HasBinding method will look up the prototype chain giving true, thus
skipping 10.5.8.c of the algorithm.
We should find a way to rework the regression test to cover the intended
code path.
For comparison, it appears that with:
__proto__.__defineGetter__("x", function() { return "getter"; });
__proto__.__defineSetter_("x", function() { alert("setter"); });
eval("try { } catch (e) { var x = false; }");
Chrome 14 dev channel: invokes the setter, but properly does not add an own
property to the global object
Safari 5.0.5: does not invoke the setter and does not add an own property
to the global object
Firefox nightly 7.0a1: does not invoke the setter, does not add an own
property to the global object, but overwrites the getter/setter pair on the
prototype with undefined
There is also some weirdness in V8 because the order of __defineSetter__
and __defineGetter__ is significant with the second surprisingly removing
the first.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev