Kevin Smith wrote:


        js> 0L == "0"
        typein:2:0 TypeError: no operator function found for ==



And what does this do?

    0L == { valueOf() { return 0 } }

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.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to