On Oct 2, 2011, at 5:02 PM, Russell Leggett wrote:
> On Oct 2, 2011, at 6:19 PM, Allen Wirfs-Brock <[email protected]> wrote:
>
>>>
>>
>> Is that the
>> SuperClass <| {
>> ...
>> }
>> part evaluates to the prototype object, not the constructor function and
>> hence what you would be naming is the prototype. This, in general, is how
>> stache has to work for arbitrary object literals where all you really are
>> trying to do is set the [[Prototype]]. There really isn't anything special
>> in your pattern that distinguishes it from that simple object case.
>
> What distinguishes it is that I was adding a new case to <| operator where
> the LHS is a constructor function and the RHS is an object literal. My
> intention was that SuperClass would be the constructor function not a
> prototype. Perhaps this is confusing because the return type is not the same
> as the same as the RHS.
Ok, your intent didn't come across.
What happens if the RHS does't have a 'constructor' property? For example:
let obj = function() {} <| {};
Would obj be a function object? If so, what is it's body. Is it the
existence of a 'constructor' property in the LHS object literal that triggers
the creation of a function object instead of a non-function?
Allen_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss