Chromium Code Reviews| Index: compiler/lib/implementation/number.js |
| =================================================================== |
| --- compiler/lib/implementation/number.js (revision 400) |
| +++ compiler/lib/implementation/number.js (working copy) |
| @@ -84,14 +84,7 @@ |
| } |
| function native_NumberImplementation_EQ(other) { |
| - if (typeof other == 'number') { |
| - return this == other; |
| - } else if (other instanceof Number) { |
| - // Must convert other to a primitive for value equality to work |
| - return this == Number(other); |
| - } else { |
| - return false; |
| - } |
| + return typeof other == 'number' && this == other; |
|
floitsch
2011/10/14 20:20:44
Same as for booleans: operator$EQ should intercept
John Lenz
2011/10/14 21:26:40
It is already special cased in EQ$operator, but I'
|
| } |
| function native_NumberImplementation_BIT_NOT() { |
| @@ -124,6 +117,10 @@ |
| return (this == Infinity) || (this == -Infinity); |
| } |
| +function native_NumberImplementation_toDouble() { |
| + return this.valueOf(); |
| +} |
| + |
| function native_NumberImplementation_toString() { |
| return this.toString(); |
| } |