Kevin Smith wrote:
What about:

    0L == "0"

So glad you asked, and you will like the answer:

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

See http://image.slidesharecdn.com/jsresp-130914140214-phpapp02/95/slide-12-638.jpg?1379296961,

For the expression v + u

1. Let p = v.[[Get]](@@ADD)
2. If p is not a Set, throw a TypeError
3. Let q = u.[[Get]](@@ADD_R)
4. If q is not a Set, throw a TypeError
5. Let r = p intersect q
6. If r.size != 1 throw a TypeError
7. Let f = r[0]; if f is not a function, throw
8. Evaluate f(v, u) and return the result

If v or u is a string, no handed-operator-symbol-named set on prototype chain.

How is "===" defined for user-defined value types? In terms of the T == T overload?

You did not read http://image.slidesharecdn.com/jsresp-130914140214-phpapp02/95/slide-9-638.jpg?1379296961 :-(.

Strict Equality Operators

 * The strict equality operators, === and !==, cannot be overloaded
 * They work on frozen-by-definition value objects via a structural
   recursive strict equality test (beware, NaN !== NaN)
 * Same-object-reference remains a fast-path optimization

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

Reply via email to