Chromium Code Reviews| Index: src/runtime.js |
| diff --git a/src/runtime.js b/src/runtime.js |
| index aaaa4fecba110c4e5e3edc0a88ea9f6a3e946e89..c2c9bb0c0b42de0c1192f32c6f2c8cfab0c87f6f 100644 |
| --- a/src/runtime.js |
| +++ b/src/runtime.js |
| @@ -199,6 +199,15 @@ function SUB(y) { |
| } |
| +//ECMA-262, section 11.6.2, page 50. |
|
rossberg
2015/04/23 13:29:37
Nit: spacing (here and below)
conradw
2015/04/23 14:51:54
Done. It looks like this is a "feature" of Eclipse
|
| +function SUB_STRONG(y) { |
| + if (IS_NUMBER(this) && IS_NUMBER(y)) { |
| + return %NumberSub(this, y); |
| + } |
| + throw %MakeTypeError('strong_implicit_cast'); |
| +} |
| + |
| + |
| // ECMA-262, section 11.5.1, page 48. |
| function MUL(y) { |
| var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| @@ -207,6 +216,15 @@ function MUL(y) { |
| } |
| +//ECMA-262, section 11.5.1, page 48. |
| +function MUL_STRONG(y) { |
| + if (IS_NUMBER(this) && IS_NUMBER(y)) { |
| + return %NumberMul(this, y); |
| + } |
| + throw %MakeTypeError('strong_implicit_cast'); |
| +} |
| + |
| + |
| // ECMA-262, section 11.5.2, page 49. |
| function DIV(y) { |
| var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| @@ -215,6 +233,15 @@ function DIV(y) { |
| } |
| +//ECMA-262, section 11.5.2, page 49. |
| +function DIV_STRONG(y) { |
| + if (IS_NUMBER(this) && IS_NUMBER(y)) { |
| + return %NumberDiv(this, y); |
| + } |
| + throw %MakeTypeError('strong_implicit_cast'); |
| +} |
| + |
| + |
| // ECMA-262, section 11.5.3, page 49. |
| function MOD(y) { |
| var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
| @@ -223,6 +250,14 @@ function MOD(y) { |
| } |
| +//ECMA-262, section 11.5.3, page 49. |
| +function MOD_STRONG(y) { |
| + if (IS_NUMBER(this) && IS_NUMBER(y)) { |
| + return %NumberMod(this, y); |
| + } |
| + throw %MakeTypeError('strong_implicit_cast'); |
| +} |
| + |
| /* ------------------------------------------- |
| - - - B i t o p e r a t i o n s - - - |