2012/12/20 Allen Wirfs-Brock <al...@wirfs-brock.com> > Yes, here is the new step 5 as I have just updated it in my spec. draft > (ignore the 1, it's really 5) > > 1. If IsDataDescriptor(*ownDesc*) is *true*, then > 1. If *ownDesc*.[[Writable]] is *false*, return *false*. > 2. If Type(*Receiver*) is not Object, return *false*. > 3. Let *existingDescriptor* be be the result of calling the > [[GetOwnProperty]] internal method of *Receiver* with argument *P*. > 4. ReturnIfAbrupt(*existingDescriptor*). > 5. If *existingDescriptor* is not *undefined*, then > 1. Let *valueDesc* be the Property Descriptor {[[Value]]: *V*}. > 2. Return the result of calling the [[DefineOwnProperty]] > internal method of *Receiver* with arguments *P* and *valueDesc*. > 6. Else *Receiver *does not currently have a property *P*, > 1. Return the result of performing CreateOwnDataProperty(* > Receiver*, *P*, *V*). > > > Allen >
Looks good! As you note, with the introduction of a user-facing Reflect.set function, Receiver can be an arbitrary object. Thus, it may be that existingDescriptor denotes an accessor property, in which case the [[DefineOwnProperty]] call will fail, but this is perfectly acceptable. Cheers, Tom
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss