B.3.1 The __proto__ pseudo property

Andrea Giammarchi andrea.giammarchi at gmail.com
Mon May 20 11:57:10 PDT 2013


that's fine with what I am thinking/saying ... it's used as reflection, to
intercept, or to trap, and not used to "do the action" of setting the
prototype so `Object` is, and you confirmed this, a better place for
`setPrototypeOf`


On Mon, May 20, 2013 at 11:29 AM, Brandon Benvie <bbenvie at mozilla.com>wrote:

> On 5/20/2013 10:55 AM, Andrea Giammarchi wrote:
>
>> I believe having a counterpart in the Object, following a natural
>> expectation where for a get you've got a set, is just fine but surely
>> Reflect should have its own "reflection power" a part.
>>
>> I see Reflect more like an introspection tool able to understand things
>> and not necessarily mutate them ( yes, similar to what is ReflectionClass
>> or ReflectionMethod in PHP, that worked there, still you cannot change an
>> object class ).
>>
>> Reflect is a good place to put a `fn.caller` equivalent and not to set
>> one, so I don't see `setPrototypeOf` a good fit for that namespace.
>>
>
> One of the primary purposes of the Reflect module is to serve as support
> for Proxy handlers. For every type of trap that Proxy supports, there is a
> corresponding function in Reflect that does the default behavior for that
> trap. Given mutable [[Prototype]], a Proxy trap for `setPrototype` needs to
> exist, and by extension `Reflect.setPrototype[Of]` needs to exist.
>
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130520/60540691/attachment.html>


More information about the es-discuss mailing list