Index: src/runtime.js |
diff --git a/src/runtime.js b/src/runtime.js |
index a4677da316d1cb28a3c96ce730e0fb1cc5926573..9bb02aecb711ab6fbb932075a187905f9b72731f 100644 |
--- a/src/runtime.js |
+++ b/src/runtime.js |
@@ -272,6 +272,15 @@ function BIT_OR(y) { |
} |
+//ECMA-262, section 11.10, page 57. |
+function BIT_OR_STRONG(y) { |
+ if (IS_NUMBER(this) && IS_NUMBER(y)) { |
+ return %NumberOr(this, y); |
+ } |
+ throw %MakeTypeError('strong_implicit_cast'); |
+} |
+ |
+ |
// ECMA-262, section 11.10, page 57. |
function BIT_AND(y) { |
var x; |
@@ -294,6 +303,15 @@ function BIT_AND(y) { |
} |
+//ECMA-262, section 11.10, page 57. |
+function BIT_AND_STRONG(y) { |
+ if (IS_NUMBER(this) && IS_NUMBER(y)) { |
+ return %NumberAnd(this, y); |
+ } |
+ throw %MakeTypeError('strong_implicit_cast'); |
+} |
+ |
+ |
// ECMA-262, section 11.10, page 57. |
function BIT_XOR(y) { |
var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
@@ -302,6 +320,15 @@ function BIT_XOR(y) { |
} |
+//ECMA-262, section 11.10, page 57. |
+function BIT_XOR_STRONG(y) { |
+ if (IS_NUMBER(this) && IS_NUMBER(y)) { |
+ return %NumberXor(this, y); |
+ } |
+ throw %MakeTypeError('strong_implicit_cast'); |
+} |
+ |
+ |
// ECMA-262, section 11.7.1, page 51. |
function SHL(y) { |
var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
@@ -310,6 +337,15 @@ function SHL(y) { |
} |
+//ECMA-262, section 11.7.1, page 51. |
+function SHL_STRONG(y) { |
+ if (IS_NUMBER(this) && IS_NUMBER(y)) { |
+ return %NumberShl(this, y); |
+ } |
+ throw %MakeTypeError('strong_implicit_cast'); |
+} |
+ |
+ |
// ECMA-262, section 11.7.2, page 51. |
function SAR(y) { |
var x; |
@@ -332,6 +368,15 @@ function SAR(y) { |
} |
+//ECMA-262, section 11.7.2, page 51. |
+function SAR_STRONG(y) { |
+ if (IS_NUMBER(this) && IS_NUMBER(y)) { |
+ return %NumberSar(this, y); |
+ } |
+ throw %MakeTypeError('strong_implicit_cast'); |
+} |
+ |
+ |
// ECMA-262, section 11.7.3, page 52. |
function SHR(y) { |
var x = IS_NUMBER(this) ? this : %NonNumberToNumber(this); |
@@ -340,6 +385,14 @@ function SHR(y) { |
} |
+//ECMA-262, section 11.7.3, page 52. |
+function SHR_STRONG(y) { |
+ if (IS_NUMBER(this) && IS_NUMBER(y)) { |
+ return %NumberShr(this, y); |
+ } |
+ throw %MakeTypeError('strong_implicit_cast'); |
+} |
+ |
/* ----------------------------- |
- - - H e l p e r s - - - |