On Apr 25, 2014, at 11:45 AM, Oliver Hunt wrote:

> 
> o = {__proto__: {set foo() {print(“bar”)}}
> o.foo = (o.__defineSetter__(“foo”, function(){ print(“foo”)})), 5

1) o.f evaluates to a Reference whose base is the value of 0 and whose 
referenced name is "foo".  No lookup occurs at this point.
2) o.__defineSetter__  creates an accessor own property on o
3) a PutValue is done using the reference from step 1.  It does a property 
lookup  and finds/uses the setter defined in step 2
4) print("foo" ) happens
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to