domenic at domenicdenicola.com (2014-05-01T23:01:14.570Z)
On Apr 25, 2014, at 11:45 AM, Oliver Hunt wrote:
> ```js
> 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 `o` 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
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