Equality Reform(ul)ation

Brendan Eich brendan at mozilla.com
Wed Jan 15 16:07:19 PST 2014


Kevin Smith wrote:
>
>
>     js> 0L == { valueOf: function() { return 0 } }
>
>     typein:2:0 TypeError: no operator function found for ==
>
>         Is the Object-type operand converted to a primitive before the
>         overload is matched?
>
>
>     No, the multimethod dispatch algorithm runs. Even with ToObject (I
>     see I left that out), there is no predefined @@ADD or @@ADD_R on
>     Object.prototype, so the error above is inevitable.
>
>
> What's the method for determining whether we run the multimethod 
> dispatch algorithm versus the ES6 abstract equality algorithm?

One or both operands value objects.

> Apologies if the answer is already out there.

No need to apol., you have exceeded my slideware neo-spec ;-).

/be


More information about the es-discuss mailing list