Chromium Code Reviews| Index: src/runtime.js |
| diff --git a/src/runtime.js b/src/runtime.js |
| index 004f9bf61bcdd1a088f12696b7216c0ead17f1c6..a1b577d7e6c91fe5eaf64ae49e4bdf74240d9f92 100644 |
| --- a/src/runtime.js |
| +++ b/src/runtime.js |
| @@ -203,6 +203,14 @@ COMPARE = function COMPARE(x, ncr) { |
| } |
| } |
| +//Strong mode COMPARE throws if an implicit conversion would be performed |
|
rossberg
2015/05/08 13:54:36
Nit: space
conradw
2015/05/08 14:08:21
Done.
|
| +COMPARE_STRONG = function COMPARE_STRONG(x, ncr) { |
| + if (IS_STRING(this) && IS_STRING(x)) return %_StringCompare(this, x); |
| + if (IS_NUMBER(this) && IS_NUMBER(x)) return %NumberCompare(this, x, ncr); |
| + |
| + throw %MakeTypeError('strong_implicit_cast'); |
| +} |
| + |
| /* ----------------------------------- |