summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/addition
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/addition')
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A1.js62
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T1.js43
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T2.js21
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T3.js21
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T1.js71
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T2.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T3.js46
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.3_T1.js28
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T1.js22
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T2.js26
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T3.js21
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T4.js16
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.1.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.2.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.3.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.1.js55
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.2.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.3.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.4.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.5.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.1.js45
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.2.js35
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.1.js66
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.2.js56
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.3.js35
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.4.js35
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T1.js42
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T2.js22
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T3.js24
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T4.js54
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T5.js50
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T6.js54
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T7.js41
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T8.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T9.js34
-rw-r--r--js/src/tests/test262/language/expressions/addition/bigint-and-number.js87
-rw-r--r--js/src/tests/test262/language/expressions/addition/bigint-arithmetic.js1403
-rw-r--r--js/src/tests/test262/language/expressions/addition/bigint-errors.js72
-rw-r--r--js/src/tests/test262/language/expressions/addition/bigint-toprimitive.js374
-rw-r--r--js/src/tests/test262/language/expressions/addition/bigint-wrapped-values.js47
-rw-r--r--js/src/tests/test262/language/expressions/addition/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/addition/coerce-bigint-to-string.js37
-rw-r--r--js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-err.js57
-rw-r--r--js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-invocation.js61
-rw-r--r--js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-obj.js50
-rw-r--r--js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-prim.js66
-rw-r--r--js/src/tests/test262/language/expressions/addition/get-symbol-to-prim-err.js53
-rw-r--r--js/src/tests/test262/language/expressions/addition/order-of-evaluation.js142
-rw-r--r--js/src/tests/test262/language/expressions/addition/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/addition/symbol-to-string.js19
50 files changed, 3799 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A1.js
new file mode 100644
index 0000000000..bf66753d3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A1.js
@@ -0,0 +1,62 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ White Space and Line Terminator between AdditiveExpression and "+" or
+ between "+" and MultiplicativeExpression are allowed
+es5id: 11.6.1_A1
+description: Checking by using eval
+---*/
+
+//CHECK#1
+if (eval("1\u0009+\u00091") !== 2) {
+ $ERROR('#1: 1\\u0009+\\u00091 === 2');
+}
+
+//CHECK#2
+if (eval("1\u000B+\u000B1") !== 2) {
+ $ERROR('#2: 1\\u000B+\\u000B1 === 2');
+}
+
+//CHECK#3
+if (eval("1\u000C+\u000C1") !== 2) {
+ $ERROR('#3: 1\\u000C+\\u000C1 === 2');
+}
+
+//CHECK#4
+if (eval("1\u0020+\u00201") !== 2) {
+ $ERROR('#4: 1\\u0020+\\u00201 === 2');
+}
+
+//CHECK#5
+if (eval("1\u00A0+\u00A01") !== 2) {
+ $ERROR('#5: 1\\u00A0+\\u00A01 === 2');
+}
+
+//CHECK#6
+if (eval("1\u000A+\u000A1") !== 2) {
+ $ERROR('#6: 1\\u000A+\\u000A1 === 2');
+}
+
+//CHECK#7
+if (eval("1\u000D+\u000D1") !== 2) {
+ $ERROR('#7: 1\\u000D+\\u000D1 === 2');
+}
+
+//CHECK#8
+if (eval("1\u2028+\u20281") !== 2) {
+ $ERROR('#8: 1\\u2028+\\u20281 === 2');
+}
+
+//CHECK#9
+if (eval("1\u2029+\u20291") !== 2) {
+ $ERROR('#9: 1\\u2029+\\u20291 === 2');
+}
+
+//CHECK#10
+if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029+\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291") !== 2) {
+ $ERROR('#10: 1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029+\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291 === 2');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T1.js
new file mode 100644
index 0000000000..42482b4d91
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T1.js
@@ -0,0 +1,43 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator x + y uses GetValue
+es5id: 11.6.1_A2.1_T1
+description: Either Type is not Reference or GetBase is not null
+---*/
+
+//CHECK#1
+if (1 + 1 !== 2) {
+ $ERROR('#1: 1 + 1 === 2. Actual: ' + (1 + 1));
+}
+
+//CHECK#2
+var x = 1;
+if (x + 1 !== 2) {
+ $ERROR('#2: var x = 1; x + 1 === 2. Actual: ' + (x + 1));
+}
+
+//CHECK#3
+var y = 1;
+if (1 + y !== 2) {
+ $ERROR('#3: var y = 1; 1 + y === 2. Actual: ' + (1 + y));
+}
+
+//CHECK#4
+var x = 1;
+var y = 1;
+if (x + y !== 2) {
+ $ERROR('#4: var x = 1; var y = 1; x + y === 2. Actual: ' + (x + y));
+}
+
+//CHECK#5
+var objectx = new Object();
+var objecty = new Object();
+objectx.prop = 1;
+objecty.prop = 1;
+if (objectx.prop + objecty.prop !== 2) {
+ $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop + objecty.prop === 2. Actual: ' + (objectx.prop + objecty.prop));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T2.js
new file mode 100644
index 0000000000..b33bcc533a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T2.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator x + y uses GetValue
+es5id: 11.6.1_A2.1_T2
+description: If GetBase(x) is null, throw ReferenceError
+---*/
+
+//CHECK#1
+try {
+ x + 1;
+ $ERROR('#1.1: x + 1 throw ReferenceError. Actual: ' + (x + 1));
+}
+catch (e) {
+ if ((e instanceof ReferenceError) !== true) {
+ $ERROR('#1.2: x + 1 throw ReferenceError. Actual: ' + (e));
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T3.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T3.js
new file mode 100644
index 0000000000..ed5779b388
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.1_T3.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator x + y uses GetValue
+es5id: 11.6.1_A2.1_T3
+description: If GetBase(y) is null, throw ReferenceError
+---*/
+
+//CHECK#1
+try {
+ 1 + y;
+ $ERROR('#1.1: 1 + y throw ReferenceError. Actual: ' + (1 + y));
+}
+catch (e) {
+ if ((e instanceof ReferenceError) !== true) {
+ $ERROR('#1.2: 1 + y throw ReferenceError. Actual: ' + (e));
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T1.js
new file mode 100644
index 0000000000..e3ed24bceb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T1.js
@@ -0,0 +1,71 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator x + y uses [[Default Value]]
+es5id: 11.6.1_A2.2_T1
+description: If Type(value) is Object, evaluate ToPrimitive(value, Number)
+---*/
+
+//CHECK#1
+if ({valueOf: function() {return 1}} + 1 !== 2) {
+ $ERROR('#1: {valueOf: function() {return 1}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}} + 1));
+}
+
+//CHECK#2
+if ({valueOf: function() {return 1}, toString: function() {return 0}} + 1 !== 2) {
+ $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} + 1));
+}
+
+//CHECK#3
+if ({valueOf: function() {return 1}, toString: function() {return {}}} + 1 !== 2) {
+ $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} + 1));
+}
+
+//CHECK#4
+try {
+ if ({valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 !== 2) {
+ $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 === 2. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw "error"}} + 1));
+ }
+}
+catch (e) {
+ if (e === "error") {
+ $ERROR('#4.2: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 not throw "error"');
+ } else {
+ $ERROR('#4.3: {valueOf: function() {return 1}, toString: function() {throw "error"}} + 1 not throw Error. Actual: ' + (e));
+ }
+}
+
+//CHECK#5
+if (1 + {toString: function() {return 1}} !== 2) {
+ $ERROR('#5: 1 + {toString: function() {return 1}} === 2. Actual: ' + (1 + {toString: function() {return 1}}));
+}
+
+//CHECK#6
+if (1 + {valueOf: function() {return {}}, toString: function() {return 1}} !== 2) {
+ $ERROR('#6: 1 + {valueOf: function() {return {}}, toString: function() {return 1}} === 2. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return 1}}));
+}
+
+//CHECK#7
+try {
+ 1 + {valueOf: function() {throw "error"}, toString: function() {return 1}};
+ $ERROR('#7.1: 1 + {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (1 + {valueOf: function() {throw "error"}, toString: function() {return 1}}));
+}
+catch (e) {
+ if (e !== "error") {
+ $ERROR('#7.2: 1 + {valueOf: function() {throw "error"}, toString: function() {return 1}} throw "error". Actual: ' + (e));
+ }
+}
+
+//CHECK#8
+try {
+ 1 + {valueOf: function() {return {}}, toString: function() {return {}}};
+ $ERROR('#8.1: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (1 + {valueOf: function() {return {}}, toString: function() {return {}}}));
+}
+catch (e) {
+ if ((e instanceof TypeError) !== true) {
+ $ERROR('#8.2: 1 + {valueOf: function() {return {}}, toString: function() {return {}}} throw TypeError. Actual: ' + (e));
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T2.js
new file mode 100644
index 0000000000..e84e8d948d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T2.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator x + y uses [[Default Value]]
+es5id: 11.6.1_A2.2_T2
+description: If Type(value) is Date object, evaluate ToPrimitive(value, String)
+---*/
+
+//CHECK#1
+var date = new Date();
+if (date + date !== date.toString() + date.toString()) {
+ $ERROR('#1: var date = new Date(); date + date === date.toString() + date.toString(). Actual: ' + (date + date));
+}
+
+//CHECK#2
+var date = new Date();
+if (date + 0 !== date.toString() + "0") {
+ $ERROR('#2: var date = new Date(); date + 0 === date.toString() + "0". Actual: ' + (date + 0));
+}
+
+//CHECK#3
+var date = new Date();
+if (date + true !== date.toString() + "true") {
+ $ERROR('#3: var date = new Date(); date + true === date.toString() + "true". Actual: ' + (date + true));
+}
+
+//CHECK#4
+var date = new Date();
+if (date + new Object() !== date.toString() + "[object Object]") {
+ $ERROR('#4: var date = new Date(); date + new Object() === date.toString() + "[object Object]". Actual: ' + (date + new Object()));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T3.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T3.js
new file mode 100644
index 0000000000..ab9182e2a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.2_T3.js
@@ -0,0 +1,46 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator x + y uses [[Default Value]]
+es5id: 11.6.1_A2.2_T3
+description: If Type(value) is Function, evaluate ToPrimitive(value, Number)
+---*/
+
+//CHECK#1
+function f1(){
+ return 0;
+}
+if (f1 + 1 !== f1.toString() + 1) {
+ $ERROR('#1: function f1() {return 0;}; f1 + 1 === f1.toString() + 1');
+}
+
+//CHECK#2
+function f2(){
+ return 0;
+}
+f2.valueOf = function() {return 1;};
+if (1 + f2 !== 1 + 1) {
+ $ERROR('#2: f1unction f2() {return 0;} f2.valueOf = function() {return 1;}; 1 + f2 === 1 + 1. Actual: ' + (1 + f2));
+}
+
+//CHECK#3
+function f3(){
+ return 0;
+}
+f3.toString = function() {return 1;};
+if (1 + f3 !== 1 + 1) {
+ $ERROR('#3: f1unction f3() {return 0;} f3.toString() = function() {return 1;}; 1 + f3 === 1 + 1. Actual: ' + (1 + f3));
+}
+
+//CHECK#4
+function f4(){
+ return 0;
+}
+f4.valueOf = function() {return -1;};
+f4.toString = function() {return 1;};
+if (f4 + 1 !== 1 - 1) {
+ $ERROR('#4: f1unction f4() {return 0;}; f2.valueOf = function() {return -1;}; f4.toString() = function() {return 1;}; f4 + 1 === 1 - 1. Actual: ' + (f4 + 1));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.3_T1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.3_T1.js
new file mode 100644
index 0000000000..3db4faa450
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.3_T1.js
@@ -0,0 +1,28 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ ToNumber(first expression) is called first, and then ToNumber(second
+ expression)
+es5id: 11.6.1_A2.3_T1
+description: Checking with "throw"
+---*/
+
+//CHECK#1
+var x = { valueOf: function () { throw "x"; } };
+var y = { valueOf: function () { throw "y"; } };
+try {
+ x + y;
+ $ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x + y throw "x". Actual: ' + (x + y));
+} catch (e) {
+ if (e === "y") {
+ $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)');
+ } else {
+ if (e !== "x") {
+ $ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x + y throw "x". Actual: ' + (e));
+ }
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T1.js
new file mode 100644
index 0000000000..c458974278
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T1.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: First expression is evaluated first, and then second expression
+es5id: 11.6.1_A2.4_T1
+description: Checking with "="
+---*/
+
+//CHECK#1
+var x = 0;
+if ((x = 1) + x !== 2) {
+ $ERROR('#1: var x = 0; (x = 1) + x === 2. Actual: ' + ((x = 1) + x));
+}
+
+//CHECK#2
+var x = 0;
+if (x + (x = 1) !== 1) {
+ $ERROR('#2: var x = 0; x + (x = 1) === 1. Actual: ' + (x + (x = 1)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T2.js
new file mode 100644
index 0000000000..846e414312
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T2.js
@@ -0,0 +1,26 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: First expression is evaluated first, and then second expression
+es5id: 11.6.1_A2.4_T2
+description: Checking with "throw"
+---*/
+
+//CHECK#1
+var x = function () { throw "x"; };
+var y = function () { throw "y"; };
+try {
+ x() + y();
+ $ERROR('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() + y() throw "x". Actual: ' + (x() + y()));
+} catch (e) {
+ if (e === "y") {
+ $ERROR('#1.2: First expression is evaluated first, and then second expression');
+ } else {
+ if (e !== "x") {
+ $ERROR('#1.3: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() + y() throw "x". Actual: ' + (e));
+ }
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T3.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T3.js
new file mode 100644
index 0000000000..fe52073e1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T3.js
@@ -0,0 +1,21 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: First expression is evaluated first, and then second expression
+es5id: 11.6.1_A2.4_T3
+description: Checking with undeclarated variables
+---*/
+
+//CHECK#1
+try {
+ x + (x = 1);
+ $ERROR('#1.1: x + (x = 1) throw ReferenceError. Actual: ' + (x + (x = 1)));
+}
+catch (e) {
+ if ((e instanceof ReferenceError) !== true) {
+ $ERROR('#1.2: x + (x = 1) throw ReferenceError. Actual: ' + (e));
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T4.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T4.js
new file mode 100644
index 0000000000..86d8a02f96
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A2.4_T4.js
@@ -0,0 +1,16 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: First expression is evaluated first, and then second expression
+es5id: 11.6.1_A2.4_T4
+description: Checking with undeclarated variables
+flags: [noStrict]
+---*/
+
+//CHECK#1
+if ((y = 1) + y !== 2) {
+ $ERROR('#1: (y = 1) + y === 2. Actual: ' + ((y = 1) + y));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.1.js
new file mode 100644
index 0000000000..64f613c89c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.1.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T1.1
+description: >
+ Type(Primitive(x)) and Type(Primitive(y)) vary between primitive
+ boolean and Boolean object
+---*/
+
+//CHECK#1
+if (true + true !== 2) {
+ $ERROR('#1: true + true === 2. Actual: ' + (true + true));
+}
+
+//CHECK#2
+if (new Boolean(true) + true !== 2) {
+ $ERROR('#2: new Boolean(true) + true === 2. Actual: ' + (new Boolean(true) + true));
+}
+
+//CHECK#3
+if (true + new Boolean(true) !== 2) {
+ $ERROR('#3: true + new Boolean(true) === 2. Actual: ' + (true + new Boolean(true)));
+}
+
+//CHECK#4
+if (new Boolean(true) + new Boolean(true) !== 2) {
+ $ERROR('#4: new Boolean(true) + new Boolean(true) === 2. Actual: ' + (new Boolean(true) + new Boolean(true)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.2.js
new file mode 100644
index 0000000000..22c6927a74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.2.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T1.2
+description: >
+ Type(Primitive(x)) and Type(Primitive(y)) vary between primitive
+ number and Number object
+---*/
+
+//CHECK#1
+if (1 + 1 !== 2) {
+ $ERROR('#1: 1 + 1 === 2. Actual: ' + (1 + 1));
+}
+
+//CHECK#2
+if (new Number(1) + 1 !== 2) {
+ $ERROR('#2: new Number(1) + 1 === 2. Actual: ' + (new Number(1) + 1));
+}
+
+//CHECK#3
+if (1 + new Number(1) !== 2) {
+ $ERROR('#3: 1 + new Number(1) === 2. Actual: ' + (1 + new Number(1)));
+}
+
+//CHECK#4
+if (new Number(1) + new Number(1) !== 2) {
+ $ERROR('#4: new Number(1) + new Number(1) === 2. Actual: ' + (new Number(1) + new Number(1)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.3.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.3.js
new file mode 100644
index 0000000000..40cac55c40
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T1.3.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T1.3
+description: >
+ Type(Primitive(x)) and Type(Primitive(y)) vary between Null and
+ Undefined
+---*/
+
+//CHECK#1
+if (isNaN(null + undefined) !== true) {
+ $ERROR('#1: null + undefined === Not-a-Number. Actual: ' + (null + undefined));
+}
+
+//CHECK#2
+if (isNaN(undefined + null) !== true) {
+ $ERROR('#2: undefined + null === Not-a-Number. Actual: ' + (undefined + null));
+}
+
+//CHECK#3
+if (isNaN(undefined + undefined) !== true) {
+ $ERROR('#3: undefined + undefined === Not-a-Number. Actual: ' + (undefined + undefined));
+}
+
+//CHECK#4
+if (null + null !== 0) {
+ $ERROR('#4: null + null === 0. Actual: ' + (null + null));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.1.js
new file mode 100644
index 0000000000..7d4f5035c3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.1.js
@@ -0,0 +1,55 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T2.1
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between Number (primitive or object) or Boolean
+ (primitive and object)
+---*/
+
+//CHECK#1
+if (true + 1 !== 2) {
+ $ERROR('#1: true + 1 === 2. Actual: ' + (true + 1));
+}
+
+//CHECK#2
+if (1 + true !== 2) {
+ $ERROR('#2: 1 + true === 2. Actual: ' + (1 + true));
+}
+
+//CHECK#3
+if (new Boolean(true) + 1 !== 2) {
+ $ERROR('#3: new Boolean(true) + 1 === 2. Actual: ' + (new Boolean(true) + 1));
+}
+
+//CHECK#4
+if (1 + new Boolean(true) !== 2) {
+ $ERROR('#4: 1 + new Boolean(true) === 2. Actual: ' + (1 + new Boolean(true)));
+}
+
+//CHECK#5
+if (true + new Number(1) !== 2) {
+ $ERROR('#5: true + new Number(1) === 2. Actual: ' + (true + new Number(1)));
+}
+
+//CHECK#6
+if (new Number(1) + true !== 2) {
+ $ERROR('#6: new Number(1) + true === 2. Actual: ' + (new Number(1) + true));
+}
+
+//CHECK#7
+if (new Boolean(true) + new Number(1) !== 2) {
+ $ERROR('#7: new Boolean(true) + new Number(1) === 2. Actual: ' + (new Boolean(true) + new Number(1)));
+}
+
+//CHECK#8
+if (new Number(1) + new Boolean(true) !== 2) {
+ $ERROR('#8: new Number(1) + new Boolean(true) === 2. Actual: ' + (new Number(1) + new Boolean(true)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.2.js
new file mode 100644
index 0000000000..9121a6759f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.2.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T2.2
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between Number (primitive or object) and Null
+---*/
+
+//CHECK#1
+if (1 + null !== 1) {
+ $ERROR('#1: 1 + null === 1. Actual: ' + (1 + null));
+}
+
+//CHECK#2
+if (null + 1 !== 1) {
+ $ERROR('#2: null + 1 === 1. Actual: ' + (null + 1));
+}
+
+//CHECK#3
+if (new Number(1) + null !== 1) {
+ $ERROR('#3: new Number(1) + null === 1. Actual: ' + (new Number(1) + null));
+}
+
+//CHECK#4
+if (null + new Number(1) !== 1) {
+ $ERROR('#4: null + new Number(1) === 1. Actual: ' + (null + new Number(1)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.3.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.3.js
new file mode 100644
index 0000000000..819d62a09b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.3.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T2.3
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between Number (primitive or object) and Undefined
+---*/
+
+//CHECK#1
+if (isNaN(1 + undefined) !== true) {
+ $ERROR('#1: 1 + undefined === Not-a-Number. Actual: ' + (1 + undefined));
+}
+
+//CHECK#2
+if (isNaN(undefined + 1) !== true) {
+ $ERROR('#2: undefined + 1 === Not-a-Number. Actual: ' + (undefined + 1));
+}
+
+//CHECK#3
+if (isNaN(new Number(1) + undefined) !== true) {
+ $ERROR('#3: new Number(1) + undefined === Not-a-Number. Actual: ' + (new Number(1) + undefined));
+}
+
+//CHECK#4
+if (isNaN(undefined + new Number(1)) !== true) {
+ $ERROR('#4: undefined + new Number(1) === Not-a-Number. Actual: ' + (undefined + new Number(1)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.4.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.4.js
new file mode 100644
index 0000000000..698f882797
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.4.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T2.4
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between Boolean (primitive or object) and Undefined
+---*/
+
+//CHECK#1
+if (isNaN(true + undefined) !== true) {
+ $ERROR('#1: true + undefined === Not-a-Number. Actual: ' + (true + undefined));
+}
+
+//CHECK#2
+if (isNaN(undefined + true) !== true) {
+ $ERROR('#2: undefined + true === Not-a-Number. Actual: ' + (undefined + true));
+}
+
+//CHECK#3
+if (isNaN(new Boolean(true) + undefined) !== true) {
+ $ERROR('#3: new Boolean(true) + undefined === Not-a-Number. Actual: ' + (new Boolean(true) + undefined));
+}
+
+//CHECK#4
+if (isNaN(undefined + new Boolean(true)) !== true) {
+ $ERROR('#4: undefined + new Boolean(true) === Not-a-Number. Actual: ' + (undefined + new Boolean(true)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.5.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.5.js
new file mode 100644
index 0000000000..a158008056
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.1_T2.5.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is not String and Type(Primitive(y)) is not String,
+ then operator x + y returns ToNumber(x) + ToNumber(y)
+es5id: 11.6.1_A3.1_T2.5
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between Boolean (primitive or object) and Null
+---*/
+
+//CHECK#1
+if (true + null !== 1) {
+ $ERROR('#1: true + null === 1. Actual: ' + (true + null));
+}
+
+//CHECK#2
+if (null + true !== 1) {
+ $ERROR('#2: null + true === 1. Actual: ' + (null + true));
+}
+
+//CHECK#3
+if (new Boolean(true) + null !== 1) {
+ $ERROR('#3: new Boolean(true) + null === 1. Actual: ' + (new Boolean(true) + null));
+}
+
+//CHECK#4
+if (null + new Boolean(true) !== 1) {
+ $ERROR('#4: null + new Boolean(true) === 1. Actual: ' + (null + new Boolean(true)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.1.js
new file mode 100644
index 0000000000..e72b6b341e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.1.js
@@ -0,0 +1,45 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
+ operator x + y returns the result of concatenating ToString(x) followed
+ by ToString(y)
+es5id: 11.6.1_A3.2_T1.1
+description: >
+ Type(Primitive(x)) and Type(Primitive(y)) vary between primitive
+ string and String object
+---*/
+
+//CHECK#1
+if ("1" + "1" !== "11") {
+ $ERROR('#1: "1" + "1" === "11". Actual: ' + ("1" + "1"));
+}
+
+//CHECK#2
+if (new String("1") + "1" !== "11") {
+ $ERROR('#2: new String("1") + "1" === "11". Actual: ' + (new String("1") + "1"));
+}
+
+//CHECK#3
+if ("1" + new String("1") !== "11") {
+ $ERROR('#3: "1" + new String("1") === "11". Actual: ' + ("1" + new String("1")));
+}
+
+//CHECK#4
+if (new String("1") + new String("1") !== "11") {
+ $ERROR('#4: new String("1") + new String("1") === "11". Actual: ' + (new String("1") + new String("1")));
+}
+
+//CHECK#5
+if ("x" + "1" !=="x1") {
+ $ERROR('#5: "x" + "1" === "x1". Actual: ' + ("x" + "1"));
+}
+
+//CHECK#6
+if ("1" + "x" !== "1x") {
+ $ERROR('#6: "1" + "x" === "1x". Actual: ' + ("1" + "x"));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.2.js
new file mode 100644
index 0000000000..fdf973ffdd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T1.2.js
@@ -0,0 +1,35 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
+ operator x + y returns the result of concatenating ToString(x) followed
+ by ToString(y)
+es5id: 11.6.1_A3.2_T1.2
+description: >
+ Type(Primitive(x)) and Type(Primitive(y)) vary between Object
+ object and Function object
+---*/
+
+//CHECK#1
+if (({} + function(){return 1}) !== ({}.toString() + function(){return 1}.toString())) {
+ $ERROR('#1: ({} + function(){return 1}) === ({}.toString() + function(){return 1}.toString()). Actual: ' + (({} + function(){return 1})));
+}
+
+//CHECK#2
+if ((function(){return 1} + {}) !== (function(){return 1}.toString() + {}.toString())) {
+ $ERROR('#2: (function(){return 1} + {}) === (function(){return 1}.toString() + {}.toString()). Actual: ' + ((function(){return 1} + {})));
+}
+
+//CHECK#3
+if ((function(){return 1} + function(){return 1}) !== (function(){return 1}.toString() + function(){return 1}.toString())) {
+ $ERROR('#3: (function(){return 1} + function(){return 1}) === (function(){return 1}.toString() + function(){return 1}.toString()). Actual: ' + ((function(){return 1} + function(){return 1})));
+}
+
+//CHECK#4
+if (({} + {}) !== ({}.toString() + {}.toString())) {
+ $ERROR('#4: ({} + {}) === ({}.toString() + {}.toString()). Actual: ' + (({} + {})));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.1.js
new file mode 100644
index 0000000000..a4d00435ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.1.js
@@ -0,0 +1,66 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
+ operator x + y returns the result of concatenating ToString(x) followed
+ by ToString(y)
+es5id: 11.6.1_A3.2_T2.1
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between Number (primitive or object) and String
+ (primitive and object)
+---*/
+
+//CHECK#1
+if ("1" + 1 !== "11") {
+ $ERROR('#1: "1" + 1 === "11". Actual: ' + ("1" + 1));
+}
+
+//CHECK#2
+if (1 + "1" !== "11") {
+ $ERROR('#2: 1 + "1" === "11". Actual: ' + (1 + "1"));
+}
+
+//CHECK#3
+if (new String("1") + 1 !== "11") {
+ $ERROR('#3: new String("1") + 1 === "11". Actual: ' + (new String("1") + 1));
+}
+
+//CHECK#4
+if (1 + new String("1") !== "11") {
+ $ERROR('#4: 1 + new String("1") === "11". Actual: ' + (1 + new String("1")));
+}
+
+//CHECK#5
+if ("1" + new Number(1) !== "11") {
+ $ERROR('#5: "1" + new Number(1) === "11". Actual: ' + ("1" + new Number(1)));
+}
+
+//CHECK#6
+if (new Number(1) + "1" !== "11") {
+ $ERROR('#6: new Number(1) + "1" === "11". Actual: ' + (new Number(1) + "1"));
+}
+
+//CHECK#7
+if (new String("1") + new Number(1) !== "11") {
+ $ERROR('#7: new String("1") + new Number(1) === "11". Actual: ' + (new String("1") + new Number(1)));
+}
+
+//CHECK#8
+if (new Number(1) + new String("1") !== "11") {
+ $ERROR('#8: new Number(1) + new String("1") === "11". Actual: ' + (new Number(1) + new String("1")));
+}
+
+//CHECK#9
+if ("x" + 1 !=="x1") {
+ $ERROR('#9: "x" + 1 === "x1". Actual: ' + ("x" + 1));
+}
+
+//CHECK#10
+if (1 + "x" !== "1x") {
+ $ERROR('#10: 1 + "x" === "1x". Actual: ' + (1 + "x"));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.2.js
new file mode 100644
index 0000000000..cfd20b4953
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.2.js
@@ -0,0 +1,56 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
+ operator x + y returns the result of concatenating ToString(x) followed
+ by ToString(y)
+es5id: 11.6.1_A3.2_T2.2
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between String (primitive or object) and Boolean
+ (primitive and object)
+---*/
+
+//CHECK#1
+if (true + "1" !== "true1") {
+ $ERROR('#1: true + "1" === "true1". Actual: ' + (true + "1"));
+}
+
+//CHECK#2
+if ("1" + true !== "1true") {
+ $ERROR('#2: "1" + true === "1true". Actual: ' + ("1" + true));
+}
+
+//CHECK#3
+if (new Boolean(true) + "1" !== "true1") {
+ $ERROR('#3: new Boolean(true) + "1" === "true1". Actual: ' + (new Boolean(true) + "1"));
+}
+
+//CHECK#4
+if ("1" + new Boolean(true) !== "1true") {
+ $ERROR('#4: "1" + new Boolean(true) === "1true". Actual: ' + ("1" + new Boolean(true)));
+}
+
+//CHECK#5
+if (true + new String("1") !== "true1") {
+ $ERROR('#5: true + new String("1") === "true1". Actual: ' + (true + new String("1")));
+}
+
+//CHECK#6
+if (new String("1") + true !== "1true") {
+ $ERROR('#6: new String("1") + true === "1true". Actual: ' + (new String("1") + true));
+}
+
+//CHECK#7
+if (new Boolean(true) + new String("1") !== "true1") {
+ $ERROR('#7: new Boolean(true) + new String("1") === "true1". Actual: ' + (new Boolean(true) + new String("1")));
+}
+
+//CHECK#8
+if (new String("1") + new Boolean(true) !== "1true") {
+ $ERROR('#8: new String("1") + new Boolean(true) === "1true". Actual: ' + (new String("1") + new Boolean(true)));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.3.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.3.js
new file mode 100644
index 0000000000..c417516d3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.3.js
@@ -0,0 +1,35 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
+ operator x + y returns the result of concatenating ToString(x) followed
+ by ToString(y)
+es5id: 11.6.1_A3.2_T2.3
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between String (primitive or object) and Undefined
+---*/
+
+//CHECK#1
+if ("1" + undefined !== "1undefined") {
+ $ERROR('#1: "1" + undefined === "1undefined". Actual: ' + ("1" + undefined));
+}
+
+//CHECK#2
+if (undefined + "1" !== "undefined1") {
+ $ERROR('#2: undefined + "1" === "undefined1". Actual: ' + (undefined + "1"));
+}
+
+//CHECK#3
+if (new String("1") + undefined !== "1undefined") {
+ $ERROR('#3: new String("1") + undefined === "1undefined". Actual: ' + (new String("1") + undefined));
+}
+
+//CHECK#4
+if (undefined + new String("1") !== "undefined1") {
+ $ERROR('#4: undefined + new String("1") === "undefined1". Actual: ' + (undefined + new String("1")));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.4.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.4.js
new file mode 100644
index 0000000000..67b1f6b286
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A3.2_T2.4.js
@@ -0,0 +1,35 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ If Type(Primitive(x)) is String or Type(Primitive(y)) is String, then
+ operator x + y returns the result of concatenating ToString(x) followed
+ by ToString(y)
+es5id: 11.6.1_A3.2_T2.4
+description: >
+ Type(Primitive(x)) is different from Type(Primitive(y)) and both
+ types vary between String (primitive or object) and Null
+---*/
+
+//CHECK#1
+if ("1" + null !== "1null") {
+ $ERROR('#1: "1" + null === "1null". Actual: ' + ("1" + null));
+}
+
+//CHECK#2
+if (null + "1" !== "null1") {
+ $ERROR('#2: null + "1" === "null1". Actual: ' + (null + "1"));
+}
+
+//CHECK#3
+if (new String("1") + null !== "1null") {
+ $ERROR('#3: new String("1") + null === "1null". Actual: ' + (new String("1") + null));
+}
+
+//CHECK#4
+if (null + new String("1") !== "null1") {
+ $ERROR('#4: null + new String("1") === "null1". Actual: ' + (null + new String("1")));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T1.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T1.js
new file mode 100644
index 0000000000..fddd527671
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T1.js
@@ -0,0 +1,42 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T1
+description: If either operand is NaN, the result is NaN
+---*/
+
+//CHECK#1
+if (isNaN(Number.NaN + 1) !== true ) {
+ $ERROR('#1: NaN + 1 === Not-a-Number. Actual: ' + (NaN + 1));
+}
+
+//CHECK#2
+if (isNaN(1 + Number.NaN) !== true ) {
+ $ERROR('#2: 1 + NaN === Not-a-Number. Actual: ' + (1 + NaN));
+}
+
+//CHECK#3
+if (isNaN(Number.NaN + Number.POSITIVE_INFINITY) !== true ) {
+ $ERROR('#3: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));
+}
+
+//CHECK#4
+if (isNaN(Number.POSITIVE_INFINITY + Number.NaN) !== true ) {
+ $ERROR('#4: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));
+}
+
+//CHECK#5
+if (isNaN(Number.NaN + Number.NEGATIVE_INFINITY) !== true ) {
+ $ERROR('#5: NaN + Infinity === Not-a-Number. Actual: ' + (NaN + Infinity));
+}
+
+//CHECK#6
+if (isNaN(Number.NEGATIVE_INFINITY + Number.NaN) !== true ) {
+ $ERROR('#6: Infinity + NaN === Not-a-Number. Actual: ' + (Infinity + NaN));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T2.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T2.js
new file mode 100644
index 0000000000..66cbba1207
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T2.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T2
+description: The sum of two infinities of opposite sign is NaN
+---*/
+
+//CHECK#1
+if (isNaN(Number.POSITIVE_INFINITY + Number.NEGATIVE_INFINITY) !== true ) {
+ $ERROR('#1: Infinity + -Infinity === Not-a-Number. Actual: ' + (Infinity + -Infinity));
+}
+
+//CHECK#2
+if (isNaN(Number.NEGATIVE_INFINITY + Number.POSITIVE_INFINITY) !== true ) {
+ $ERROR('#2: -Infinity + Infinity === Not-a-Number. Actual: ' + (-Infinity + Infinity));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T3.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T3.js
new file mode 100644
index 0000000000..714743304b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T3.js
@@ -0,0 +1,24 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T3
+description: >
+ The sum of two infinities of the same sign is the infinity of that
+ sign
+---*/
+
+//CHECK#1
+if (Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ) {
+ $ERROR('#1: Infinity + Infinity === Infinity. Actual: ' + (Infinity + Infinity));
+}
+
+//CHECK#2
+if (Number.NEGATIVE_INFINITY + Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {
+ $ERROR('#2: -Infinity + -Infinity === -Infinity. Actual: ' + (-Infinity + -Infinity));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T4.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T4.js
new file mode 100644
index 0000000000..fe5e6bdec0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T4.js
@@ -0,0 +1,54 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T4
+description: >
+ The sum of an infinity and a finite value is equal to the infinite
+ operand
+---*/
+
+//CHECK#1
+if (Number.POSITIVE_INFINITY + 1 !== Number.POSITIVE_INFINITY ) {
+ $ERROR('#1: Infinity + 1 === Infinity. Actual: ' + (Infinity + 1));
+}
+
+//CHECK#2
+if (-1 + Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ) {
+ $ERROR('#2: -1 + Infinity === Infinity. Actual: ' + (-1 + Infinity));
+}
+
+//CHECK#3
+if (Number.NEGATIVE_INFINITY + 1 !== Number.NEGATIVE_INFINITY ) {
+ $ERROR('#3: -Infinity + 1 === -Infinity. Actual: ' + (-Infinity + 1));
+}
+
+//CHECK#4
+if (-1 + Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {
+ $ERROR('#4: -1 + -Infinity === -Infinity. Actual: ' + (-1 + -Infinity));
+}
+
+//CHECK#5
+if (Number.POSITIVE_INFINITY + Number.MAX_VALUE !== Number.POSITIVE_INFINITY ) {
+ $ERROR('#5: Infinity + Number.MAX_VALUE === Infinity. Actual: ' + (Infinity + Number.MAX_VALUE));
+}
+
+//CHECK#6
+if (-Number.MAX_VALUE + Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY ) {
+ $ERROR('#6: -Number.MAX_VALUE + Infinity === Infinity. Actual: ' + (-Number.MAX_VALUE + Infinity));
+}
+
+//CHECK#7
+if (Number.NEGATIVE_INFINITY + Number.MAX_VALUE !== Number.NEGATIVE_INFINITY ) {
+ $ERROR('#7: -Infinity + Number.MAX_VALUE === -Infinity. Actual: ' + (-Infinity + Number.MAX_VALUE));
+}
+
+//CHECK#8
+if (-Number.MAX_VALUE + Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY ) {
+ $ERROR('#8: -Number.MAX_VALUE + -Infinity === -Infinity. Actual: ' + (-Number.MAX_VALUE + -Infinity));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T5.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T5.js
new file mode 100644
index 0000000000..c5d10b8f93
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T5.js
@@ -0,0 +1,50 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T5
+description: >
+ The sum of two negative zeros is -0. The sum of two positive
+ zeros, or of two zeros of opposite sign is +0
+---*/
+
+//CHECK#1
+if (-0 + -0 !== -0 ) {
+ $ERROR('#1.1: -0 + -0 === 0. Actual: ' + (-0 + -0));
+} else {
+ if (1 / (-0 + -0) !== Number.NEGATIVE_INFINITY) {
+ $ERROR('#1.1: -0 + -0 === - 0. Actual: +0');
+ }
+}
+
+//CHECK#2
+if (0 + -0 !== 0 ) {
+ $ERROR('#2.1: 0 + -0 === 0. Actual: ' + (0 + -0));
+} else {
+ if (1 / (0 + -0) !== Number.POSITIVE_INFINITY) {
+ $ERROR('#2.2: 0 + -0 === + 0. Actual: -0');
+ }
+}
+
+//CHECK#3
+if (-0 + 0 !== 0 ) {
+ $ERROR('#3.1: -0 + 0 === 0. Actual: ' + (-0 + 0));
+} else {
+ if (1 / (-0 + 0) !== Number.POSITIVE_INFINITY) {
+ $ERROR('#3.2: -0 + 0 === + 0. Actual: -0');
+ }
+}
+
+//CHECK#4
+if (0 + 0 !== 0 ) {
+ $ERROR('#4.1: 0 + 0 === 0. Actual: ' + (0 + 0));
+} else {
+ if (1 / (0 + 0) !== Number.POSITIVE_INFINITY) {
+ $ERROR('#4.2: 0 + 0 === + 0. Actual: -0');
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T6.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T6.js
new file mode 100644
index 0000000000..e9952970d7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T6.js
@@ -0,0 +1,54 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T6
+description: >
+ The sum of a zero and a nonzero finite value is equal to the
+ nonzero operand
+---*/
+
+//CHECK#1
+if (1 + -0 !== 1 ) {
+ $ERROR('#1: 1 + -0 === 1. Actual: ' + (1 + -0));
+}
+
+//CHECK#2
+if (1 + 0 !== 1 ) {
+ $ERROR('#2: 1 + 0 === 1. Actual: ' + (1 + 0));
+}
+
+//CHECK#3
+if (-0 + 1 !== 1 ) {
+ $ERROR('#3: -0 + 1 === 1. Actual: ' + (-0 + 1));
+}
+
+//CHECK#4
+if (0 + 1 !== 1 ) {
+ $ERROR('#4: 0 + 1 === 1. Actual: ' + (0 + 1));
+}
+
+//CHECK#5
+if (Number.MAX_VALUE + -0 !== Number.MAX_VALUE ) {
+ $ERROR('#5: Number.MAX_VALUE + -0 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE + -0));
+}
+
+//CHECK#6
+if (Number.MAX_VALUE + 0 !== Number.MAX_VALUE ) {
+ $ERROR('#6: Number.MAX_VALUE + 0 === Number.MAX_VALUE. Actual: ' + (Number.MAX_VALUE + 0));
+}
+
+//CHECK#7
+if (-0 + Number.MIN_VALUE !== Number.MIN_VALUE ) {
+ $ERROR('#7: -0 + Number.MIN_VALUE === Number.MIN_VALUE. Actual: ' + (-0 + Number.MIN_VALUE));
+}
+
+//CHECK#8
+if (0 + Number.MIN_VALUE !== Number.MIN_VALUE ) {
+ $ERROR('#8: 0 + Number.MIN_VALUE === Number.MIN_VALUE. Actual: ' + (0 + Number.MIN_VALUE));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T7.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T7.js
new file mode 100644
index 0000000000..8434b7b4a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T7.js
@@ -0,0 +1,41 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T7
+description: >
+ The sum of two nonzero finite values of the same magnitude and
+ opposite sign is +0
+---*/
+
+//CHECK#1
+if (-Number.MIN_VALUE + Number.MIN_VALUE !== +0) {
+ $ERROR('#1.1: -Number.MIN_VALUE + Number.MIN_VALUE === 0. Actual: ' + (-Number.MIN_VALUE + Number.MIN_VALUE));
+} else {
+ if (1 / (-Number.MIN_VALUE + Number.MIN_VALUE) !== Number.POSITIVE_INFINITY) {
+ $ERROR('#1.2: -Number.MIN_VALUE + Number.MIN_VALUE === + 0. Actual: -0');
+ }
+}
+
+//CHECK#2
+if (-Number.MAX_VALUE + Number.MAX_VALUE !== +0) {
+ $ERROR('#2.1: -Number.MAX_VALUE + Number.MAX_VALUE === 0. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE));
+} else {
+ if (1 / (-Number.MAX_VALUE + Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {
+ $ERROR('#2.2: -Number.MAX_VALUE + Number.MAX_VALUE === + 0. Actual: -0');
+ }
+}
+
+//CHECK#3
+if (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE !== +0) {
+ $ERROR('#3.1: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === 0. Actual: ' + (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE));
+} else {
+ if (1 / (-1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE) !== Number.POSITIVE_INFINITY) {
+ $ERROR('#3.2: -1 / Number.MAX_VALUE + 1 / Number.MAX_VALUE === + 0. Actual: -0');
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T8.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T8.js
new file mode 100644
index 0000000000..da1e7d5110
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T8.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T8
+description: >
+ If the magnitude is too large to represent, the operation
+ overflows and the result is then an infinity of appropriate sign
+---*/
+
+//CHECK#1
+if (Number.MAX_VALUE + Number.MAX_VALUE !== Number.POSITIVE_INFINITY) {
+ $ERROR('#1: Number.MAX_VALUE + Number.MAX_VALUE === Number.POSITIVE_INFINITY. Actual: ' + (Number.MAX_VALUE + Number.MAX_VALUE));
+}
+
+//CHECK#2
+if (-Number.MAX_VALUE - Number.MAX_VALUE !== Number.NEGATIVE_INFINITY) {
+ $ERROR('#2: -Number.MAX_VALUE - Number.MAX_VALUE === Number.NEGATIVE_INFINITY. Actual: ' + (-Number.MAX_VALUE - Number.MAX_VALUE));
+}
+
+//CHECK#3
+if (1e+308 + 1e+308 !== Number.POSITIVE_INFINITY) {
+ $ERROR('#3: 1e+308 + 1e+308 === Number.POSITIVE_INFINITY. Actual: ' + (1e+308 + 1e+308));
+}
+
+//CHECK#4
+if (-8.99e+307 - 8.99e+307 !== Number.NEGATIVE_INFINITY) {
+ $ERROR('#4: -8.99e+307 - 8.99e+307 === Number.NEGATIVE_INFINITY. Actual: ' + (-8.99e+307 - 8.99e+307));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T9.js b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T9.js
new file mode 100644
index 0000000000..444e4b0212
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/S11.6.1_A4_T9.js
@@ -0,0 +1,34 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ The result of an addition is determined using the rules of IEEE 754
+ double-precision arithmetics
+es5id: 11.6.1_A4_T9
+description: >
+ The addition operator is not always associative ( x + y + z is the
+ same (x + y) + z, not x + (y + z))
+---*/
+
+//CHECK#1
+if (-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE !== (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE) {
+ $ERROR('#1: -Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE === (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE. Actual: ' + (-Number.MAX_VALUE + Number.MAX_VALUE + Number.MAX_VALUE));
+}
+
+//CHECK#2
+if ((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE === -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE)) {
+ $ERROR('#2: (-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE === -Number.MAX_VALUE + (Number.MAX_VALUE + Number.MAX_VALUE). Actual: ' + ((-Number.MAX_VALUE + Number.MAX_VALUE) + Number.MAX_VALUE));
+}
+
+//CHECK#3
+if ("1" + 1 + 1 !== ("1" + 1) + 1) {
+ $ERROR('#3: "1" + 1 + 1 === ("1" + 1) + 1. Actual: ' + ("1" + 1 + 1));
+}
+
+//CHECK#4
+if (("1" + 1) + 1 === "1" + (1 + 1)) {
+ $ERROR('#4: ("1" + 1) + 1 !== "1" + (1 + 1)');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/bigint-and-number.js b/js/src/tests/test262/language/expressions/addition/bigint-and-number.js
new file mode 100644
index 0000000000..28cc14b315
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/bigint-and-number.js
@@ -0,0 +1,87 @@
+// Copyright (C) 2018 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+description: Mixing BigInt and Number produces a TypeError for addition operator
+features: [BigInt]
+info: |
+ Let lprim be ? ToPrimitive(lval).
+ Let rprim be ? ToPrimitive(rval).
+ ...
+ Let lnum be ? ToNumeric(lprim)
+ Let rnum be ? ToNumeric(rprim)
+ If Type(lnum) does not equal Type(rnum), throw a TypeError exception.
+---*/
+assert.throws(TypeError, function() {
+ 1n + 1;
+}, '1n + 1 throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1 + 1n;
+}, '1 + 1n throws TypeError');
+
+assert.throws(TypeError, function() {
+ Object(1n) + 1;
+}, 'Object(1n) + 1 throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1 + Object(1n);
+}, '1 + Object(1n) throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1n + Object(1);
+}, '1n + Object(1) throws TypeError');
+
+assert.throws(TypeError, function() {
+ Object(1) + 1n;
+}, 'Object(1) + 1n throws TypeError');
+
+assert.throws(TypeError, function() {
+ Object(1n) + Object(1);
+}, 'Object(1n) + Object(1) throws TypeError');
+
+assert.throws(TypeError, function() {
+ Object(1) + Object(1n);
+}, 'Object(1) + Object(1n) throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1n + NaN;
+}, '1n + NaN throws TypeError');
+
+assert.throws(TypeError, function() {
+ NaN + 1n;
+}, 'NaN + 1n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1n + Infinity;
+}, '1n + Infinity throws TypeError');
+
+assert.throws(TypeError, function() {
+ Infinity + 1n;
+}, 'Infinity + 1n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1n + true;
+}, '1n + true throws TypeError');
+
+assert.throws(TypeError, function() {
+ true + 1n;
+}, 'true + 1n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1n + null;
+}, '1n + null throws TypeError');
+
+assert.throws(TypeError, function() {
+ null + 1n;
+}, 'null + 1n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 1n + undefined;
+}, '1n + undefined throws TypeError');
+
+assert.throws(TypeError, function() {
+ undefined + 1n;
+}, 'undefined + 1n throws TypeError');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/bigint-arithmetic.js b/js/src/tests/test262/language/expressions/addition/bigint-arithmetic.js
new file mode 100644
index 0000000000..39b21fb086
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/bigint-arithmetic.js
@@ -0,0 +1,1403 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+description: BigInt addition arithmetic
+features: [BigInt]
+---*/
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA9876543210n,
+ 0x1FDB97530ECA86420n,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA9876543210n) is 0x1FDB97530ECA86420n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA9876543210n,
+ 0x1FDB97530ECA86420n,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA9876543210n) is 0x1FDB97530ECA86420n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA987654320Fn,
+ 0x1FDB97530ECA8641Fn,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA987654320Fn) is 0x1FDB97530ECA8641Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA987654320Fn,
+ 0x1FDB97530ECA8641Fn,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA987654320Fn) is 0x1FDB97530ECA8641Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA98n,
+ 0xFEDCBA997530ECA8n,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA98n) is 0xFEDCBA997530ECA8n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA98n,
+ 0xFEDCBA997530ECA8n,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA98n) is 0xFEDCBA997530ECA8n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA97n,
+ 0xFEDCBA997530ECA7n,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA97n) is 0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0xFEDCBA97n,
+ 0xFEDCBA997530ECA7n,
+ 'The result of (0xFEDCBA9876543210n + 0xFEDCBA97n) is 0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x1234n,
+ 0xFEDCBA9876544444n,
+ 'The result of (0xFEDCBA9876543210n + 0x1234n) is 0xFEDCBA9876544444n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x1234n,
+ 0xFEDCBA9876544444n,
+ 'The result of (0xFEDCBA9876543210n + 0x1234n) is 0xFEDCBA9876544444n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x3n,
+ 0xFEDCBA9876543213n,
+ 'The result of (0xFEDCBA9876543210n + 0x3n) is 0xFEDCBA9876543213n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x3n,
+ 0xFEDCBA9876543213n,
+ 'The result of (0xFEDCBA9876543210n + 0x3n) is 0xFEDCBA9876543213n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x2n,
+ 0xFEDCBA9876543212n,
+ 'The result of (0xFEDCBA9876543210n + 0x2n) is 0xFEDCBA9876543212n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x2n,
+ 0xFEDCBA9876543212n,
+ 'The result of (0xFEDCBA9876543210n + 0x2n) is 0xFEDCBA9876543212n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x1n,
+ 0xFEDCBA9876543211n,
+ 'The result of (0xFEDCBA9876543210n + 0x1n) is 0xFEDCBA9876543211n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x1n,
+ 0xFEDCBA9876543211n,
+ 'The result of (0xFEDCBA9876543210n + 0x1n) is 0xFEDCBA9876543211n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x0n,
+ 0xFEDCBA9876543210n,
+ 'The result of (0xFEDCBA9876543210n + 0x0n) is 0xFEDCBA9876543210n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + 0x0n,
+ 0xFEDCBA9876543210n,
+ 'The result of (0xFEDCBA9876543210n + 0x0n) is 0xFEDCBA9876543210n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x1n,
+ 0xFEDCBA987654320Fn,
+ 'The result of (0xFEDCBA9876543210n + -0x1n) is 0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x1n,
+ 0xFEDCBA987654320Fn,
+ 'The result of (0xFEDCBA9876543210n + -0x1n) is 0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x2n,
+ 0xFEDCBA987654320En,
+ 'The result of (0xFEDCBA9876543210n + -0x2n) is 0xFEDCBA987654320En'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x2n,
+ 0xFEDCBA987654320En,
+ 'The result of (0xFEDCBA9876543210n + -0x2n) is 0xFEDCBA987654320En'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x3n,
+ 0xFEDCBA987654320Dn,
+ 'The result of (0xFEDCBA9876543210n + -0x3n) is 0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x3n,
+ 0xFEDCBA987654320Dn,
+ 'The result of (0xFEDCBA9876543210n + -0x3n) is 0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x1234n,
+ 0xFEDCBA9876541FDCn,
+ 'The result of (0xFEDCBA9876543210n + -0x1234n) is 0xFEDCBA9876541FDCn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0x1234n,
+ 0xFEDCBA9876541FDCn,
+ 'The result of (0xFEDCBA9876543210n + -0x1234n) is 0xFEDCBA9876541FDCn'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA97n,
+ 0xFEDCBA9777777779n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA97n) is 0xFEDCBA9777777779n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA97n,
+ 0xFEDCBA9777777779n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA97n) is 0xFEDCBA9777777779n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA98n,
+ 0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA98n) is 0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA98n,
+ 0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA98n) is 0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA987654320Fn,
+ 0x1n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA987654320Fn) is 0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA987654320Fn,
+ 0x1n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA987654320Fn) is 0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA9876543210n,
+ 0x0n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA9876543210n) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA9876543210n + -0xFEDCBA9876543210n,
+ 0x0n,
+ 'The result of (0xFEDCBA9876543210n + -0xFEDCBA9876543210n) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0xFEDCBA987654320Fn,
+ 0x1FDB97530ECA8641En,
+ 'The result of (0xFEDCBA987654320Fn + 0xFEDCBA987654320Fn) is 0x1FDB97530ECA8641En'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0xFEDCBA987654320Fn,
+ 0x1FDB97530ECA8641En,
+ 'The result of (0xFEDCBA987654320Fn + 0xFEDCBA987654320Fn) is 0x1FDB97530ECA8641En'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0xFEDCBA98n,
+ 0xFEDCBA997530ECA7n,
+ 'The result of (0xFEDCBA987654320Fn + 0xFEDCBA98n) is 0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0xFEDCBA98n,
+ 0xFEDCBA997530ECA7n,
+ 'The result of (0xFEDCBA987654320Fn + 0xFEDCBA98n) is 0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0xFEDCBA97n,
+ 0xFEDCBA997530ECA6n,
+ 'The result of (0xFEDCBA987654320Fn + 0xFEDCBA97n) is 0xFEDCBA997530ECA6n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0xFEDCBA97n,
+ 0xFEDCBA997530ECA6n,
+ 'The result of (0xFEDCBA987654320Fn + 0xFEDCBA97n) is 0xFEDCBA997530ECA6n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x1234n,
+ 0xFEDCBA9876544443n,
+ 'The result of (0xFEDCBA987654320Fn + 0x1234n) is 0xFEDCBA9876544443n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x1234n,
+ 0xFEDCBA9876544443n,
+ 'The result of (0xFEDCBA987654320Fn + 0x1234n) is 0xFEDCBA9876544443n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x3n,
+ 0xFEDCBA9876543212n,
+ 'The result of (0xFEDCBA987654320Fn + 0x3n) is 0xFEDCBA9876543212n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x3n,
+ 0xFEDCBA9876543212n,
+ 'The result of (0xFEDCBA987654320Fn + 0x3n) is 0xFEDCBA9876543212n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x2n,
+ 0xFEDCBA9876543211n,
+ 'The result of (0xFEDCBA987654320Fn + 0x2n) is 0xFEDCBA9876543211n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x2n,
+ 0xFEDCBA9876543211n,
+ 'The result of (0xFEDCBA987654320Fn + 0x2n) is 0xFEDCBA9876543211n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x1n,
+ 0xFEDCBA9876543210n,
+ 'The result of (0xFEDCBA987654320Fn + 0x1n) is 0xFEDCBA9876543210n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x1n,
+ 0xFEDCBA9876543210n,
+ 'The result of (0xFEDCBA987654320Fn + 0x1n) is 0xFEDCBA9876543210n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x0n,
+ 0xFEDCBA987654320Fn,
+ 'The result of (0xFEDCBA987654320Fn + 0x0n) is 0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + 0x0n,
+ 0xFEDCBA987654320Fn,
+ 'The result of (0xFEDCBA987654320Fn + 0x0n) is 0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x1n,
+ 0xFEDCBA987654320En,
+ 'The result of (0xFEDCBA987654320Fn + -0x1n) is 0xFEDCBA987654320En'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x1n,
+ 0xFEDCBA987654320En,
+ 'The result of (0xFEDCBA987654320Fn + -0x1n) is 0xFEDCBA987654320En'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x2n,
+ 0xFEDCBA987654320Dn,
+ 'The result of (0xFEDCBA987654320Fn + -0x2n) is 0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x2n,
+ 0xFEDCBA987654320Dn,
+ 'The result of (0xFEDCBA987654320Fn + -0x2n) is 0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x3n,
+ 0xFEDCBA987654320Cn,
+ 'The result of (0xFEDCBA987654320Fn + -0x3n) is 0xFEDCBA987654320Cn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x3n,
+ 0xFEDCBA987654320Cn,
+ 'The result of (0xFEDCBA987654320Fn + -0x3n) is 0xFEDCBA987654320Cn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x1234n,
+ 0xFEDCBA9876541FDBn,
+ 'The result of (0xFEDCBA987654320Fn + -0x1234n) is 0xFEDCBA9876541FDBn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0x1234n,
+ 0xFEDCBA9876541FDBn,
+ 'The result of (0xFEDCBA987654320Fn + -0x1234n) is 0xFEDCBA9876541FDBn'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA97n,
+ 0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA97n) is 0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA97n,
+ 0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA97n) is 0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA98n,
+ 0xFEDCBA9777777777n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA98n) is 0xFEDCBA9777777777n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA98n,
+ 0xFEDCBA9777777777n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA98n) is 0xFEDCBA9777777777n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn,
+ 0x0n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn,
+ 0x0n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA9876543210n,
+ -0x1n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA9876543210n) is -0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA987654320Fn + -0xFEDCBA9876543210n,
+ -0x1n,
+ 'The result of (0xFEDCBA987654320Fn + -0xFEDCBA9876543210n) is -0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0xFEDCBA98n,
+ 0x1FDB97530n,
+ 'The result of (0xFEDCBA98n + 0xFEDCBA98n) is 0x1FDB97530n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0xFEDCBA98n,
+ 0x1FDB97530n,
+ 'The result of (0xFEDCBA98n + 0xFEDCBA98n) is 0x1FDB97530n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0xFEDCBA97n,
+ 0x1FDB9752Fn,
+ 'The result of (0xFEDCBA98n + 0xFEDCBA97n) is 0x1FDB9752Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0xFEDCBA97n,
+ 0x1FDB9752Fn,
+ 'The result of (0xFEDCBA98n + 0xFEDCBA97n) is 0x1FDB9752Fn'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x1234n,
+ 0xFEDCCCCCn,
+ 'The result of (0xFEDCBA98n + 0x1234n) is 0xFEDCCCCCn'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x1234n,
+ 0xFEDCCCCCn,
+ 'The result of (0xFEDCBA98n + 0x1234n) is 0xFEDCCCCCn'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x3n,
+ 0xFEDCBA9Bn,
+ 'The result of (0xFEDCBA98n + 0x3n) is 0xFEDCBA9Bn'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x3n,
+ 0xFEDCBA9Bn,
+ 'The result of (0xFEDCBA98n + 0x3n) is 0xFEDCBA9Bn'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x2n,
+ 0xFEDCBA9An,
+ 'The result of (0xFEDCBA98n + 0x2n) is 0xFEDCBA9An'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x2n,
+ 0xFEDCBA9An,
+ 'The result of (0xFEDCBA98n + 0x2n) is 0xFEDCBA9An'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x1n,
+ 0xFEDCBA99n,
+ 'The result of (0xFEDCBA98n + 0x1n) is 0xFEDCBA99n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x1n,
+ 0xFEDCBA99n,
+ 'The result of (0xFEDCBA98n + 0x1n) is 0xFEDCBA99n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x0n,
+ 0xFEDCBA98n,
+ 'The result of (0xFEDCBA98n + 0x0n) is 0xFEDCBA98n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + 0x0n,
+ 0xFEDCBA98n,
+ 'The result of (0xFEDCBA98n + 0x0n) is 0xFEDCBA98n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x1n,
+ 0xFEDCBA97n,
+ 'The result of (0xFEDCBA98n + -0x1n) is 0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x1n,
+ 0xFEDCBA97n,
+ 'The result of (0xFEDCBA98n + -0x1n) is 0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x2n,
+ 0xFEDCBA96n,
+ 'The result of (0xFEDCBA98n + -0x2n) is 0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x2n,
+ 0xFEDCBA96n,
+ 'The result of (0xFEDCBA98n + -0x2n) is 0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x3n,
+ 0xFEDCBA95n,
+ 'The result of (0xFEDCBA98n + -0x3n) is 0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x3n,
+ 0xFEDCBA95n,
+ 'The result of (0xFEDCBA98n + -0x3n) is 0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x1234n,
+ 0xFEDCA864n,
+ 'The result of (0xFEDCBA98n + -0x1234n) is 0xFEDCA864n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0x1234n,
+ 0xFEDCA864n,
+ 'The result of (0xFEDCBA98n + -0x1234n) is 0xFEDCA864n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA97n,
+ 0x1n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA97n) is 0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA97n,
+ 0x1n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA97n) is 0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA98n,
+ 0x0n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA98n) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA98n,
+ 0x0n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA98n) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9777777777n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA987654320Fn) is -0xFEDCBA9777777777n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9777777777n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA987654320Fn) is -0xFEDCBA9777777777n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA9876543210n) is -0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA98n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA98n + -0xFEDCBA9876543210n) is -0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0xFEDCBA97n,
+ 0x1FDB9752En,
+ 'The result of (0xFEDCBA97n + 0xFEDCBA97n) is 0x1FDB9752En'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0xFEDCBA97n,
+ 0x1FDB9752En,
+ 'The result of (0xFEDCBA97n + 0xFEDCBA97n) is 0x1FDB9752En'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x1234n,
+ 0xFEDCCCCBn,
+ 'The result of (0xFEDCBA97n + 0x1234n) is 0xFEDCCCCBn'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x1234n,
+ 0xFEDCCCCBn,
+ 'The result of (0xFEDCBA97n + 0x1234n) is 0xFEDCCCCBn'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x3n,
+ 0xFEDCBA9An,
+ 'The result of (0xFEDCBA97n + 0x3n) is 0xFEDCBA9An'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x3n,
+ 0xFEDCBA9An,
+ 'The result of (0xFEDCBA97n + 0x3n) is 0xFEDCBA9An'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x2n,
+ 0xFEDCBA99n,
+ 'The result of (0xFEDCBA97n + 0x2n) is 0xFEDCBA99n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x2n,
+ 0xFEDCBA99n,
+ 'The result of (0xFEDCBA97n + 0x2n) is 0xFEDCBA99n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x1n,
+ 0xFEDCBA98n,
+ 'The result of (0xFEDCBA97n + 0x1n) is 0xFEDCBA98n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x1n,
+ 0xFEDCBA98n,
+ 'The result of (0xFEDCBA97n + 0x1n) is 0xFEDCBA98n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x0n,
+ 0xFEDCBA97n,
+ 'The result of (0xFEDCBA97n + 0x0n) is 0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + 0x0n,
+ 0xFEDCBA97n,
+ 'The result of (0xFEDCBA97n + 0x0n) is 0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x1n,
+ 0xFEDCBA96n,
+ 'The result of (0xFEDCBA97n + -0x1n) is 0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x1n,
+ 0xFEDCBA96n,
+ 'The result of (0xFEDCBA97n + -0x1n) is 0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x2n,
+ 0xFEDCBA95n,
+ 'The result of (0xFEDCBA97n + -0x2n) is 0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x2n,
+ 0xFEDCBA95n,
+ 'The result of (0xFEDCBA97n + -0x2n) is 0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x3n,
+ 0xFEDCBA94n,
+ 'The result of (0xFEDCBA97n + -0x3n) is 0xFEDCBA94n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x3n,
+ 0xFEDCBA94n,
+ 'The result of (0xFEDCBA97n + -0x3n) is 0xFEDCBA94n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x1234n,
+ 0xFEDCA863n,
+ 'The result of (0xFEDCBA97n + -0x1234n) is 0xFEDCA863n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0x1234n,
+ 0xFEDCA863n,
+ 'The result of (0xFEDCBA97n + -0x1234n) is 0xFEDCA863n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA97n,
+ 0x0n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA97n) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA97n,
+ 0x0n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA97n) is 0x0n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA98n,
+ -0x1n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA98n) is -0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA98n,
+ -0x1n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA98n) is -0x1n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA987654320Fn) is -0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9777777778n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA987654320Fn) is -0xFEDCBA9777777778n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9777777779n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA9876543210n) is -0xFEDCBA9777777779n'
+);
+
+assert.sameValue(
+ 0xFEDCBA97n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9777777779n,
+ 'The result of (0xFEDCBA97n + -0xFEDCBA9876543210n) is -0xFEDCBA9777777779n'
+);
+
+assert.sameValue(0x1234n + 0x1234n, 0x2468n, 'The result of (0x1234n + 0x1234n) is 0x2468n');
+assert.sameValue(0x1234n + 0x1234n, 0x2468n, 'The result of (0x1234n + 0x1234n) is 0x2468n');
+assert.sameValue(0x1234n + 0x3n, 0x1237n, 'The result of (0x1234n + 0x3n) is 0x1237n');
+assert.sameValue(0x1234n + 0x3n, 0x1237n, 'The result of (0x1234n + 0x3n) is 0x1237n');
+assert.sameValue(0x1234n + 0x2n, 0x1236n, 'The result of (0x1234n + 0x2n) is 0x1236n');
+assert.sameValue(0x1234n + 0x2n, 0x1236n, 'The result of (0x1234n + 0x2n) is 0x1236n');
+assert.sameValue(0x1234n + 0x1n, 0x1235n, 'The result of (0x1234n + 0x1n) is 0x1235n');
+assert.sameValue(0x1234n + 0x1n, 0x1235n, 'The result of (0x1234n + 0x1n) is 0x1235n');
+assert.sameValue(0x1234n + 0x0n, 0x1234n, 'The result of (0x1234n + 0x0n) is 0x1234n');
+assert.sameValue(0x1234n + 0x0n, 0x1234n, 'The result of (0x1234n + 0x0n) is 0x1234n');
+assert.sameValue(0x1234n + -0x1n, 0x1233n, 'The result of (0x1234n + -0x1n) is 0x1233n');
+assert.sameValue(0x1234n + -0x1n, 0x1233n, 'The result of (0x1234n + -0x1n) is 0x1233n');
+assert.sameValue(0x1234n + -0x2n, 0x1232n, 'The result of (0x1234n + -0x2n) is 0x1232n');
+assert.sameValue(0x1234n + -0x2n, 0x1232n, 'The result of (0x1234n + -0x2n) is 0x1232n');
+assert.sameValue(0x1234n + -0x3n, 0x1231n, 'The result of (0x1234n + -0x3n) is 0x1231n');
+assert.sameValue(0x1234n + -0x3n, 0x1231n, 'The result of (0x1234n + -0x3n) is 0x1231n');
+assert.sameValue(0x1234n + -0x1234n, 0x0n, 'The result of (0x1234n + -0x1234n) is 0x0n');
+assert.sameValue(0x1234n + -0x1234n, 0x0n, 'The result of (0x1234n + -0x1234n) is 0x0n');
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA97n,
+ -0xFEDCA863n,
+ 'The result of (0x1234n + -0xFEDCBA97n) is -0xFEDCA863n'
+);
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA97n,
+ -0xFEDCA863n,
+ 'The result of (0x1234n + -0xFEDCBA97n) is -0xFEDCA863n'
+);
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA98n,
+ -0xFEDCA864n,
+ 'The result of (0x1234n + -0xFEDCBA98n) is -0xFEDCA864n'
+);
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA98n,
+ -0xFEDCA864n,
+ 'The result of (0x1234n + -0xFEDCBA98n) is -0xFEDCA864n'
+);
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876541FDBn,
+ 'The result of (0x1234n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876541FDBn'
+);
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876541FDBn,
+ 'The result of (0x1234n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876541FDBn'
+);
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876541FDCn,
+ 'The result of (0x1234n + -0xFEDCBA9876543210n) is -0xFEDCBA9876541FDCn'
+);
+
+assert.sameValue(
+ 0x1234n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876541FDCn,
+ 'The result of (0x1234n + -0xFEDCBA9876543210n) is -0xFEDCBA9876541FDCn'
+);
+
+assert.sameValue(0x3n + 0x3n, 0x6n, 'The result of (0x3n + 0x3n) is 0x6n');
+assert.sameValue(0x3n + 0x3n, 0x6n, 'The result of (0x3n + 0x3n) is 0x6n');
+assert.sameValue(0x3n + 0x2n, 0x5n, 'The result of (0x3n + 0x2n) is 0x5n');
+assert.sameValue(0x3n + 0x2n, 0x5n, 'The result of (0x3n + 0x2n) is 0x5n');
+assert.sameValue(0x3n + 0x1n, 0x4n, 'The result of (0x3n + 0x1n) is 0x4n');
+assert.sameValue(0x3n + 0x1n, 0x4n, 'The result of (0x3n + 0x1n) is 0x4n');
+assert.sameValue(0x3n + 0x0n, 0x3n, 'The result of (0x3n + 0x0n) is 0x3n');
+assert.sameValue(0x3n + 0x0n, 0x3n, 'The result of (0x3n + 0x0n) is 0x3n');
+assert.sameValue(0x3n + -0x1n, 0x2n, 'The result of (0x3n + -0x1n) is 0x2n');
+assert.sameValue(0x3n + -0x1n, 0x2n, 'The result of (0x3n + -0x1n) is 0x2n');
+assert.sameValue(0x3n + -0x2n, 0x1n, 'The result of (0x3n + -0x2n) is 0x1n');
+assert.sameValue(0x3n + -0x2n, 0x1n, 'The result of (0x3n + -0x2n) is 0x1n');
+assert.sameValue(0x3n + -0x3n, 0x0n, 'The result of (0x3n + -0x3n) is 0x0n');
+assert.sameValue(0x3n + -0x3n, 0x0n, 'The result of (0x3n + -0x3n) is 0x0n');
+assert.sameValue(0x3n + -0x1234n, -0x1231n, 'The result of (0x3n + -0x1234n) is -0x1231n');
+assert.sameValue(0x3n + -0x1234n, -0x1231n, 'The result of (0x3n + -0x1234n) is -0x1231n');
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA97n,
+ -0xFEDCBA94n,
+ 'The result of (0x3n + -0xFEDCBA97n) is -0xFEDCBA94n'
+);
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA97n,
+ -0xFEDCBA94n,
+ 'The result of (0x3n + -0xFEDCBA97n) is -0xFEDCBA94n'
+);
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA98n,
+ -0xFEDCBA95n,
+ 'The result of (0x3n + -0xFEDCBA98n) is -0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA98n,
+ -0xFEDCBA95n,
+ 'The result of (0x3n + -0xFEDCBA98n) is -0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320Cn,
+ 'The result of (0x3n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320Cn'
+);
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320Cn,
+ 'The result of (0x3n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320Cn'
+);
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA9876543210n,
+ -0xFEDCBA987654320Dn,
+ 'The result of (0x3n + -0xFEDCBA9876543210n) is -0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(
+ 0x3n + -0xFEDCBA9876543210n,
+ -0xFEDCBA987654320Dn,
+ 'The result of (0x3n + -0xFEDCBA9876543210n) is -0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(0x2n + 0x2n, 0x4n, 'The result of (0x2n + 0x2n) is 0x4n');
+assert.sameValue(0x2n + 0x2n, 0x4n, 'The result of (0x2n + 0x2n) is 0x4n');
+assert.sameValue(0x2n + 0x1n, 0x3n, 'The result of (0x2n + 0x1n) is 0x3n');
+assert.sameValue(0x2n + 0x1n, 0x3n, 'The result of (0x2n + 0x1n) is 0x3n');
+assert.sameValue(0x2n + 0x0n, 0x2n, 'The result of (0x2n + 0x0n) is 0x2n');
+assert.sameValue(0x2n + 0x0n, 0x2n, 'The result of (0x2n + 0x0n) is 0x2n');
+assert.sameValue(0x2n + -0x1n, 0x1n, 'The result of (0x2n + -0x1n) is 0x1n');
+assert.sameValue(0x2n + -0x1n, 0x1n, 'The result of (0x2n + -0x1n) is 0x1n');
+assert.sameValue(0x2n + -0x2n, 0x0n, 'The result of (0x2n + -0x2n) is 0x0n');
+assert.sameValue(0x2n + -0x2n, 0x0n, 'The result of (0x2n + -0x2n) is 0x0n');
+assert.sameValue(0x2n + -0x3n, -0x1n, 'The result of (0x2n + -0x3n) is -0x1n');
+assert.sameValue(0x2n + -0x3n, -0x1n, 'The result of (0x2n + -0x3n) is -0x1n');
+assert.sameValue(0x2n + -0x1234n, -0x1232n, 'The result of (0x2n + -0x1234n) is -0x1232n');
+assert.sameValue(0x2n + -0x1234n, -0x1232n, 'The result of (0x2n + -0x1234n) is -0x1232n');
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA97n,
+ -0xFEDCBA95n,
+ 'The result of (0x2n + -0xFEDCBA97n) is -0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA97n,
+ -0xFEDCBA95n,
+ 'The result of (0x2n + -0xFEDCBA97n) is -0xFEDCBA95n'
+);
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA98n,
+ -0xFEDCBA96n,
+ 'The result of (0x2n + -0xFEDCBA98n) is -0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA98n,
+ -0xFEDCBA96n,
+ 'The result of (0x2n + -0xFEDCBA98n) is -0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320Dn,
+ 'The result of (0x2n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320Dn,
+ 'The result of (0x2n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320Dn'
+);
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA9876543210n,
+ -0xFEDCBA987654320En,
+ 'The result of (0x2n + -0xFEDCBA9876543210n) is -0xFEDCBA987654320En'
+);
+
+assert.sameValue(
+ 0x2n + -0xFEDCBA9876543210n,
+ -0xFEDCBA987654320En,
+ 'The result of (0x2n + -0xFEDCBA9876543210n) is -0xFEDCBA987654320En'
+);
+
+assert.sameValue(0x1n + 0x1n, 0x2n, 'The result of (0x1n + 0x1n) is 0x2n');
+assert.sameValue(0x1n + 0x1n, 0x2n, 'The result of (0x1n + 0x1n) is 0x2n');
+assert.sameValue(0x1n + 0x0n, 0x1n, 'The result of (0x1n + 0x0n) is 0x1n');
+assert.sameValue(0x1n + 0x0n, 0x1n, 'The result of (0x1n + 0x0n) is 0x1n');
+assert.sameValue(0x1n + -0x1n, 0x0n, 'The result of (0x1n + -0x1n) is 0x0n');
+assert.sameValue(0x1n + -0x1n, 0x0n, 'The result of (0x1n + -0x1n) is 0x0n');
+assert.sameValue(0x1n + -0x2n, -0x1n, 'The result of (0x1n + -0x2n) is -0x1n');
+assert.sameValue(0x1n + -0x2n, -0x1n, 'The result of (0x1n + -0x2n) is -0x1n');
+assert.sameValue(0x1n + -0x3n, -0x2n, 'The result of (0x1n + -0x3n) is -0x2n');
+assert.sameValue(0x1n + -0x3n, -0x2n, 'The result of (0x1n + -0x3n) is -0x2n');
+assert.sameValue(0x1n + -0x1234n, -0x1233n, 'The result of (0x1n + -0x1234n) is -0x1233n');
+assert.sameValue(0x1n + -0x1234n, -0x1233n, 'The result of (0x1n + -0x1234n) is -0x1233n');
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA97n,
+ -0xFEDCBA96n,
+ 'The result of (0x1n + -0xFEDCBA97n) is -0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA97n,
+ -0xFEDCBA96n,
+ 'The result of (0x1n + -0xFEDCBA97n) is -0xFEDCBA96n'
+);
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA98n,
+ -0xFEDCBA97n,
+ 'The result of (0x1n + -0xFEDCBA98n) is -0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA98n,
+ -0xFEDCBA97n,
+ 'The result of (0x1n + -0xFEDCBA98n) is -0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320En,
+ 'The result of (0x1n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320En'
+);
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320En,
+ 'The result of (0x1n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320En'
+);
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA9876543210n,
+ -0xFEDCBA987654320Fn,
+ 'The result of (0x1n + -0xFEDCBA9876543210n) is -0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(
+ 0x1n + -0xFEDCBA9876543210n,
+ -0xFEDCBA987654320Fn,
+ 'The result of (0x1n + -0xFEDCBA9876543210n) is -0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(0x0n + 0x0n, 0x0n, 'The result of (0x0n + 0x0n) is 0x0n');
+assert.sameValue(0x0n + 0x0n, 0x0n, 'The result of (0x0n + 0x0n) is 0x0n');
+assert.sameValue(0x0n + -0x1n, -0x1n, 'The result of (0x0n + -0x1n) is -0x1n');
+assert.sameValue(0x0n + -0x1n, -0x1n, 'The result of (0x0n + -0x1n) is -0x1n');
+assert.sameValue(0x0n + -0x2n, -0x2n, 'The result of (0x0n + -0x2n) is -0x2n');
+assert.sameValue(0x0n + -0x2n, -0x2n, 'The result of (0x0n + -0x2n) is -0x2n');
+assert.sameValue(0x0n + -0x3n, -0x3n, 'The result of (0x0n + -0x3n) is -0x3n');
+assert.sameValue(0x0n + -0x3n, -0x3n, 'The result of (0x0n + -0x3n) is -0x3n');
+assert.sameValue(0x0n + -0x1234n, -0x1234n, 'The result of (0x0n + -0x1234n) is -0x1234n');
+assert.sameValue(0x0n + -0x1234n, -0x1234n, 'The result of (0x0n + -0x1234n) is -0x1234n');
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA97n,
+ -0xFEDCBA97n,
+ 'The result of (0x0n + -0xFEDCBA97n) is -0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA97n,
+ -0xFEDCBA97n,
+ 'The result of (0x0n + -0xFEDCBA97n) is -0xFEDCBA97n'
+);
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA98n,
+ -0xFEDCBA98n,
+ 'The result of (0x0n + -0xFEDCBA98n) is -0xFEDCBA98n'
+);
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA98n,
+ -0xFEDCBA98n,
+ 'The result of (0x0n + -0xFEDCBA98n) is -0xFEDCBA98n'
+);
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320Fn,
+ 'The result of (0x0n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA987654320Fn,
+ 'The result of (0x0n + -0xFEDCBA987654320Fn) is -0xFEDCBA987654320Fn'
+);
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543210n,
+ 'The result of (0x0n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543210n'
+);
+
+assert.sameValue(
+ 0x0n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543210n,
+ 'The result of (0x0n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543210n'
+);
+
+assert.sameValue(-0x1n + -0x1n, -0x2n, 'The result of (-0x1n + -0x1n) is -0x2n');
+assert.sameValue(-0x1n + -0x1n, -0x2n, 'The result of (-0x1n + -0x1n) is -0x2n');
+assert.sameValue(-0x1n + -0x2n, -0x3n, 'The result of (-0x1n + -0x2n) is -0x3n');
+assert.sameValue(-0x1n + -0x2n, -0x3n, 'The result of (-0x1n + -0x2n) is -0x3n');
+assert.sameValue(-0x1n + -0x3n, -0x4n, 'The result of (-0x1n + -0x3n) is -0x4n');
+assert.sameValue(-0x1n + -0x3n, -0x4n, 'The result of (-0x1n + -0x3n) is -0x4n');
+assert.sameValue(-0x1n + -0x1234n, -0x1235n, 'The result of (-0x1n + -0x1234n) is -0x1235n');
+assert.sameValue(-0x1n + -0x1234n, -0x1235n, 'The result of (-0x1n + -0x1234n) is -0x1235n');
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA97n,
+ -0xFEDCBA98n,
+ 'The result of (-0x1n + -0xFEDCBA97n) is -0xFEDCBA98n'
+);
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA97n,
+ -0xFEDCBA98n,
+ 'The result of (-0x1n + -0xFEDCBA97n) is -0xFEDCBA98n'
+);
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA98n,
+ -0xFEDCBA99n,
+ 'The result of (-0x1n + -0xFEDCBA98n) is -0xFEDCBA99n'
+);
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA98n,
+ -0xFEDCBA99n,
+ 'The result of (-0x1n + -0xFEDCBA98n) is -0xFEDCBA99n'
+);
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876543210n,
+ 'The result of (-0x1n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876543210n'
+);
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876543210n,
+ 'The result of (-0x1n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876543210n'
+);
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543211n,
+ 'The result of (-0x1n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543211n'
+);
+
+assert.sameValue(
+ -0x1n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543211n,
+ 'The result of (-0x1n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543211n'
+);
+
+assert.sameValue(-0x2n + -0x2n, -0x4n, 'The result of (-0x2n + -0x2n) is -0x4n');
+assert.sameValue(-0x2n + -0x2n, -0x4n, 'The result of (-0x2n + -0x2n) is -0x4n');
+assert.sameValue(-0x2n + -0x3n, -0x5n, 'The result of (-0x2n + -0x3n) is -0x5n');
+assert.sameValue(-0x2n + -0x3n, -0x5n, 'The result of (-0x2n + -0x3n) is -0x5n');
+assert.sameValue(-0x2n + -0x1234n, -0x1236n, 'The result of (-0x2n + -0x1234n) is -0x1236n');
+assert.sameValue(-0x2n + -0x1234n, -0x1236n, 'The result of (-0x2n + -0x1234n) is -0x1236n');
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA97n,
+ -0xFEDCBA99n,
+ 'The result of (-0x2n + -0xFEDCBA97n) is -0xFEDCBA99n'
+);
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA97n,
+ -0xFEDCBA99n,
+ 'The result of (-0x2n + -0xFEDCBA97n) is -0xFEDCBA99n'
+);
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA98n,
+ -0xFEDCBA9An,
+ 'The result of (-0x2n + -0xFEDCBA98n) is -0xFEDCBA9An'
+);
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA98n,
+ -0xFEDCBA9An,
+ 'The result of (-0x2n + -0xFEDCBA98n) is -0xFEDCBA9An'
+);
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876543211n,
+ 'The result of (-0x2n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876543211n'
+);
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876543211n,
+ 'The result of (-0x2n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876543211n'
+);
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543212n,
+ 'The result of (-0x2n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543212n'
+);
+
+assert.sameValue(
+ -0x2n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543212n,
+ 'The result of (-0x2n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543212n'
+);
+
+assert.sameValue(-0x3n + -0x3n, -0x6n, 'The result of (-0x3n + -0x3n) is -0x6n');
+assert.sameValue(-0x3n + -0x3n, -0x6n, 'The result of (-0x3n + -0x3n) is -0x6n');
+assert.sameValue(-0x3n + -0x1234n, -0x1237n, 'The result of (-0x3n + -0x1234n) is -0x1237n');
+assert.sameValue(-0x3n + -0x1234n, -0x1237n, 'The result of (-0x3n + -0x1234n) is -0x1237n');
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA97n,
+ -0xFEDCBA9An,
+ 'The result of (-0x3n + -0xFEDCBA97n) is -0xFEDCBA9An'
+);
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA97n,
+ -0xFEDCBA9An,
+ 'The result of (-0x3n + -0xFEDCBA97n) is -0xFEDCBA9An'
+);
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA98n,
+ -0xFEDCBA9Bn,
+ 'The result of (-0x3n + -0xFEDCBA98n) is -0xFEDCBA9Bn'
+);
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA98n,
+ -0xFEDCBA9Bn,
+ 'The result of (-0x3n + -0xFEDCBA98n) is -0xFEDCBA9Bn'
+);
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876543212n,
+ 'The result of (-0x3n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876543212n'
+);
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876543212n,
+ 'The result of (-0x3n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876543212n'
+);
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543213n,
+ 'The result of (-0x3n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543213n'
+);
+
+assert.sameValue(
+ -0x3n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876543213n,
+ 'The result of (-0x3n + -0xFEDCBA9876543210n) is -0xFEDCBA9876543213n'
+);
+
+assert.sameValue(-0x1234n + -0x1234n, -0x2468n, 'The result of (-0x1234n + -0x1234n) is -0x2468n');
+assert.sameValue(-0x1234n + -0x1234n, -0x2468n, 'The result of (-0x1234n + -0x1234n) is -0x2468n');
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA97n,
+ -0xFEDCCCCBn,
+ 'The result of (-0x1234n + -0xFEDCBA97n) is -0xFEDCCCCBn'
+);
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA97n,
+ -0xFEDCCCCBn,
+ 'The result of (-0x1234n + -0xFEDCBA97n) is -0xFEDCCCCBn'
+);
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA98n,
+ -0xFEDCCCCCn,
+ 'The result of (-0x1234n + -0xFEDCBA98n) is -0xFEDCCCCCn'
+);
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA98n,
+ -0xFEDCCCCCn,
+ 'The result of (-0x1234n + -0xFEDCBA98n) is -0xFEDCCCCCn'
+);
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876544443n,
+ 'The result of (-0x1234n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876544443n'
+);
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA9876544443n,
+ 'The result of (-0x1234n + -0xFEDCBA987654320Fn) is -0xFEDCBA9876544443n'
+);
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876544444n,
+ 'The result of (-0x1234n + -0xFEDCBA9876543210n) is -0xFEDCBA9876544444n'
+);
+
+assert.sameValue(
+ -0x1234n + -0xFEDCBA9876543210n,
+ -0xFEDCBA9876544444n,
+ 'The result of (-0x1234n + -0xFEDCBA9876543210n) is -0xFEDCBA9876544444n'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA97n,
+ -0x1FDB9752En,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA97n) is -0x1FDB9752En'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA97n,
+ -0x1FDB9752En,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA97n) is -0x1FDB9752En'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA98n,
+ -0x1FDB9752Fn,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA98n) is -0x1FDB9752Fn'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA98n,
+ -0x1FDB9752Fn,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA98n) is -0x1FDB9752Fn'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA997530ECA6n,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA987654320Fn) is -0xFEDCBA997530ECA6n'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA997530ECA6n,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA987654320Fn) is -0xFEDCBA997530ECA6n'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA9876543210n,
+ -0xFEDCBA997530ECA7n,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA9876543210n) is -0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ -0xFEDCBA97n + -0xFEDCBA9876543210n,
+ -0xFEDCBA997530ECA7n,
+ 'The result of (-0xFEDCBA97n + -0xFEDCBA9876543210n) is -0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ -0xFEDCBA98n + -0xFEDCBA98n,
+ -0x1FDB97530n,
+ 'The result of (-0xFEDCBA98n + -0xFEDCBA98n) is -0x1FDB97530n'
+);
+
+assert.sameValue(
+ -0xFEDCBA98n + -0xFEDCBA98n,
+ -0x1FDB97530n,
+ 'The result of (-0xFEDCBA98n + -0xFEDCBA98n) is -0x1FDB97530n'
+);
+
+assert.sameValue(
+ -0xFEDCBA98n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA997530ECA7n,
+ 'The result of (-0xFEDCBA98n + -0xFEDCBA987654320Fn) is -0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ -0xFEDCBA98n + -0xFEDCBA987654320Fn,
+ -0xFEDCBA997530ECA7n,
+ 'The result of (-0xFEDCBA98n + -0xFEDCBA987654320Fn) is -0xFEDCBA997530ECA7n'
+);
+
+assert.sameValue(
+ -0xFEDCBA98n + -0xFEDCBA9876543210n,
+ -0xFEDCBA997530ECA8n,
+ 'The result of (-0xFEDCBA98n + -0xFEDCBA9876543210n) is -0xFEDCBA997530ECA8n'
+);
+
+assert.sameValue(
+ -0xFEDCBA98n + -0xFEDCBA9876543210n,
+ -0xFEDCBA997530ECA8n,
+ 'The result of (-0xFEDCBA98n + -0xFEDCBA9876543210n) is -0xFEDCBA997530ECA8n'
+);
+
+assert.sameValue(
+ -0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn,
+ -0x1FDB97530ECA8641En,
+ 'The result of (-0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn) is -0x1FDB97530ECA8641En'
+);
+
+assert.sameValue(
+ -0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn,
+ -0x1FDB97530ECA8641En,
+ 'The result of (-0xFEDCBA987654320Fn + -0xFEDCBA987654320Fn) is -0x1FDB97530ECA8641En'
+);
+
+assert.sameValue(
+ -0xFEDCBA987654320Fn + -0xFEDCBA9876543210n,
+ -0x1FDB97530ECA8641Fn,
+ 'The result of (-0xFEDCBA987654320Fn + -0xFEDCBA9876543210n) is -0x1FDB97530ECA8641Fn'
+);
+
+assert.sameValue(
+ -0xFEDCBA987654320Fn + -0xFEDCBA9876543210n,
+ -0x1FDB97530ECA8641Fn,
+ 'The result of (-0xFEDCBA987654320Fn + -0xFEDCBA9876543210n) is -0x1FDB97530ECA8641Fn'
+);
+
+assert.sameValue(
+ -0xFEDCBA9876543210n + -0xFEDCBA9876543210n,
+ -0x1FDB97530ECA86420n,
+ 'The result of (-0xFEDCBA9876543210n + -0xFEDCBA9876543210n) is -0x1FDB97530ECA86420n'
+);
+
+assert.sameValue(
+ -0xFEDCBA9876543210n + -0xFEDCBA9876543210n,
+ -0x1FDB97530ECA86420n,
+ 'The result of (-0xFEDCBA9876543210n + -0xFEDCBA9876543210n) is -0x1FDB97530ECA86420n'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/bigint-errors.js b/js/src/tests/test262/language/expressions/addition/bigint-errors.js
new file mode 100644
index 0000000000..fbfc6021c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/bigint-errors.js
@@ -0,0 +1,72 @@
+// Copyright (C) 2017 Josh Wolfe. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: addition operator ToNumeric with BigInt operands
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+features: [BigInt, Symbol, Symbol.toPrimitive, computed-property-names]
+---*/
+assert.throws(TypeError, function() {
+ Symbol('1') + 0n;
+}, 'Symbol("1") + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + Symbol('1');
+}, '0n + Symbol("1") throws TypeError');
+
+assert.throws(TypeError, function() {
+ Object(Symbol('1')) + 0n;
+}, 'Object(Symbol("1")) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + Object(Symbol('1'));
+}, '0n + Object(Symbol("1")) throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ [Symbol.toPrimitive]: function() {
+ return Symbol('1');
+ }
+ }) + 0n;
+}, '({[Symbol.toPrimitive]: function() {return Symbol("1");}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ [Symbol.toPrimitive]: function() {
+ return Symbol('1');
+ }
+ };
+}, '0n + {[Symbol.toPrimitive]: function() {return Symbol("1");}} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ valueOf: function() {
+ return Symbol('1');
+ }
+ }) + 0n;
+}, '({valueOf: function() {return Symbol("1");}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ valueOf: function() {
+ return Symbol('1');
+ }
+ };
+}, '0n + {valueOf: function() {return Symbol("1");}} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ toString: function() {
+ return Symbol('1');
+ }
+ }) + 0n;
+}, '({toString: function() {return Symbol("1");}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ toString: function() {
+ return Symbol('1');
+ }
+ };
+}, '0n + {toString: function() {return Symbol("1");}} throws TypeError');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/bigint-toprimitive.js b/js/src/tests/test262/language/expressions/addition/bigint-toprimitive.js
new file mode 100644
index 0000000000..ddd4608c31
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/bigint-toprimitive.js
@@ -0,0 +1,374 @@
+// Copyright (C) 2017 Josh Wolfe. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: addition operator ToNumeric with BigInt operands
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+features: [BigInt, Symbol.toPrimitive, computed-property-names]
+---*/
+function err() {
+ throw new Test262Error();
+}
+
+function MyError() {}
+
+assert.sameValue({
+ [Symbol.toPrimitive]: function() {
+ return 2n;
+ },
+
+ valueOf: err,
+ toString: err
+} + 1n, 3n, 'The result of (({[Symbol.toPrimitive]: function() {return 2n;}, valueOf: err, toString: err}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ [Symbol.toPrimitive]: function() {
+ return 2n;
+ },
+
+ valueOf: err,
+ toString: err
+}, 3n, 'The result of (1n + {[Symbol.toPrimitive]: function() {return 2n;}, valueOf: err, toString: err}) is 3n');
+
+assert.sameValue({
+ valueOf: function() {
+ return 2n;
+ },
+
+ toString: err
+} + 1n, 3n, 'The result of (({valueOf: function() {return 2n;}, toString: err}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ valueOf: function() {
+ return 2n;
+ },
+
+ toString: err
+}, 3n, 'The result of (1n + {valueOf: function() {return 2n;}, toString: err}) is 3n');
+
+assert.sameValue({
+ toString: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({toString: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ toString: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {toString: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ [Symbol.toPrimitive]: undefined,
+
+ valueOf: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({[Symbol.toPrimitive]: undefined, valueOf: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ [Symbol.toPrimitive]: undefined,
+
+ valueOf: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {[Symbol.toPrimitive]: undefined, valueOf: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ [Symbol.toPrimitive]: null,
+
+ valueOf: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({[Symbol.toPrimitive]: null, valueOf: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ [Symbol.toPrimitive]: null,
+
+ valueOf: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {[Symbol.toPrimitive]: null, valueOf: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ valueOf: null,
+
+ toString: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({valueOf: null, toString: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ valueOf: null,
+
+ toString: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {valueOf: null, toString: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ valueOf: 1,
+
+ toString: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({valueOf: 1, toString: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ valueOf: 1,
+
+ toString: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {valueOf: 1, toString: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ valueOf: {},
+
+ toString: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({valueOf: {}, toString: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ valueOf: {},
+
+ toString: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {valueOf: {}, toString: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ valueOf: function() {
+ return {};
+ },
+
+ toString: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({valueOf: function() {return {};}, toString: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ valueOf: function() {
+ return {};
+ },
+
+ toString: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {valueOf: function() {return {};}, toString: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ valueOf: function() {
+ return Object(12345);
+ },
+
+ toString: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({valueOf: function() {return Object(12345);}, toString: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ valueOf: function() {
+ return Object(12345);
+ },
+
+ toString: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {valueOf: function() {return Object(12345);}, toString: function() {return 2n;}}) is 3n');
+
+assert.throws(TypeError, function() {
+ ({
+ [Symbol.toPrimitive]: 1
+ }) + 0n;
+}, '({[Symbol.toPrimitive]: 1}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ [Symbol.toPrimitive]: 1
+ };
+}, '0n + {[Symbol.toPrimitive]: 1} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ [Symbol.toPrimitive]: {}
+ }) + 0n;
+}, '({[Symbol.toPrimitive]: {}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ [Symbol.toPrimitive]: {}
+ };
+}, '0n + {[Symbol.toPrimitive]: {}} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ [Symbol.toPrimitive]: function() {
+ return Object(1);
+ }
+ }) + 0n;
+}, '({[Symbol.toPrimitive]: function() {return Object(1);}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ [Symbol.toPrimitive]: function() {
+ return Object(1);
+ }
+ };
+}, '0n + {[Symbol.toPrimitive]: function() {return Object(1);}} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ [Symbol.toPrimitive]: function() {
+ return {};
+ }
+ }) + 0n;
+}, '({[Symbol.toPrimitive]: function() {return {};}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ [Symbol.toPrimitive]: function() {
+ return {};
+ }
+ };
+}, '0n + {[Symbol.toPrimitive]: function() {return {};}} throws TypeError');
+
+assert.throws(MyError, function() {
+ ({
+ [Symbol.toPrimitive]: function() {
+ throw new MyError();
+ }
+ }) + 0n;
+}, '({[Symbol.toPrimitive]: function() {throw new MyError();}}) + 0n throws MyError');
+
+assert.throws(MyError, function() {
+ 0n + {
+ [Symbol.toPrimitive]: function() {
+ throw new MyError();
+ }
+ };
+}, '0n + {[Symbol.toPrimitive]: function() {throw new MyError();}} throws MyError');
+
+assert.throws(MyError, function() {
+ ({
+ valueOf: function() {
+ throw new MyError();
+ }
+ }) + 0n;
+}, '({valueOf: function() {throw new MyError();}}) + 0n throws MyError');
+
+assert.throws(MyError, function() {
+ 0n + {
+ valueOf: function() {
+ throw new MyError();
+ }
+ };
+}, '0n + {valueOf: function() {throw new MyError();}} throws MyError');
+
+assert.throws(MyError, function() {
+ ({
+ toString: function() {
+ throw new MyError();
+ }
+ }) + 0n;
+}, '({toString: function() {throw new MyError();}}) + 0n throws MyError');
+
+assert.throws(MyError, function() {
+ 0n + {
+ toString: function() {
+ throw new MyError();
+ }
+ };
+}, '0n + {toString: function() {throw new MyError();}} throws MyError');
+
+assert.throws(TypeError, function() {
+ ({
+ valueOf: null,
+ toString: null
+ }) + 0n;
+}, '({valueOf: null, toString: null}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ valueOf: null,
+ toString: null
+ };
+}, '0n + {valueOf: null, toString: null} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ valueOf: 1,
+ toString: 1
+ }) + 0n;
+}, '({valueOf: 1, toString: 1}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ valueOf: 1,
+ toString: 1
+ };
+}, '0n + {valueOf: 1, toString: 1} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ valueOf: {},
+ toString: {}
+ }) + 0n;
+}, '({valueOf: {}, toString: {}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ valueOf: {},
+ toString: {}
+ };
+}, '0n + {valueOf: {}, toString: {}} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ valueOf: function() {
+ return Object(1);
+ },
+
+ toString: function() {
+ return Object(1);
+ }
+ }) + 0n;
+}, '({valueOf: function() {return Object(1);}, toString: function() {return Object(1);}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ valueOf: function() {
+ return Object(1);
+ },
+
+ toString: function() {
+ return Object(1);
+ }
+ };
+}, '0n + {valueOf: function() {return Object(1);}, toString: function() {return Object(1);}} throws TypeError');
+
+assert.throws(TypeError, function() {
+ ({
+ valueOf: function() {
+ return {};
+ },
+
+ toString: function() {
+ return {};
+ }
+ }) + 0n;
+}, '({valueOf: function() {return {};}, toString: function() {return {};}}) + 0n throws TypeError');
+
+assert.throws(TypeError, function() {
+ 0n + {
+ valueOf: function() {
+ return {};
+ },
+
+ toString: function() {
+ return {};
+ }
+ };
+}, '0n + {valueOf: function() {return {};}, toString: function() {return {};}} throws TypeError');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/bigint-wrapped-values.js b/js/src/tests/test262/language/expressions/addition/bigint-wrapped-values.js
new file mode 100644
index 0000000000..2b31c35fc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/bigint-wrapped-values.js
@@ -0,0 +1,47 @@
+// Copyright (C) 2017 Josh Wolfe. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: addition operator ToNumeric with BigInt operands
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+features: [BigInt, Symbol.toPrimitive, computed-property-names]
+---*/
+assert.sameValue(Object(2n) + 1n, 3n, 'The result of (Object(2n) + 1n) is 3n');
+assert.sameValue(1n + Object(2n), 3n, 'The result of (1n + Object(2n)) is 3n');
+
+assert.sameValue({
+ [Symbol.toPrimitive]: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({[Symbol.toPrimitive]: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ [Symbol.toPrimitive]: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {[Symbol.toPrimitive]: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ valueOf: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({valueOf: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ valueOf: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {valueOf: function() {return 2n;}}) is 3n');
+
+assert.sameValue({
+ toString: function() {
+ return 2n;
+ }
+} + 1n, 3n, 'The result of (({toString: function() {return 2n;}}) + 1n) is 3n');
+
+assert.sameValue(1n + {
+ toString: function() {
+ return 2n;
+ }
+}, 3n, 'The result of (1n + {toString: function() {return 2n;}}) is 3n');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/browser.js b/js/src/tests/test262/language/expressions/addition/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/browser.js
diff --git a/js/src/tests/test262/language/expressions/addition/coerce-bigint-to-string.js b/js/src/tests/test262/language/expressions/addition/coerce-bigint-to-string.js
new file mode 100644
index 0000000000..eff75fff29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/coerce-bigint-to-string.js
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: ToString is applied BigInt values in an additive expression with another string
+esid: prod-AdditiveExpression
+info: |
+ AdditiveExpression: AdditiveExpression + MultiplicativeExpression
+
+ ...
+ 7. If Type(lprim) is String or Type(rprim) is String, then
+ a. Let lstr be ? ToString(lprim).
+ b. Let rstr be ? ToString(rprim).
+ c. Return the String that is the result of concatenating lstr and rstr.
+ ...
+
+ ToString Applied to the BigInt Type
+
+ 1. If i is less than zero, return the String concatenation of the String "-" and ToString(-i).
+ 2. Return the String consisting of the code units of the digits of the decimal representation of i.
+features: [BigInt]
+---*/
+
+function ToString(x) { return x + ""; }
+
+assert.sameValue(-1n + "", "-1");
+assert.sameValue("" + -1n, "-1");
+assert.sameValue(0n + "", "0");
+assert.sameValue("" + 0n, "0");
+assert.sameValue(1n + "", "1");
+assert.sameValue("" + 1n, "1");
+assert.sameValue(123456789000000000000000n + "", "123456789000000000000000");
+assert.sameValue("" + 123456789000000000000000n, "123456789000000000000000");
+assert.sameValue(-123456789000000000000000n + "", "-123456789000000000000000");
+assert.sameValue("" + -123456789000000000000000n, "-123456789000000000000000");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-err.js b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-err.js
new file mode 100644
index 0000000000..13617e9dc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-err.js
@@ -0,0 +1,57 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+es6id: 12.7.3.1
+description: >
+ Behavior when error thrown by invocation of `Symbol.toPrimitive` method
+ during coercion
+info: |
+ [...]
+ 5. Let lprim be ? ToPrimitive(lval).
+ 6. Let rprim be ? ToPrimitive(rval).
+ [...]
+
+ ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
+
+ [...]
+ 4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
+ 5. ReturnIfAbrupt(exoticToPrim).
+ 6. If exoticToPrim is not undefined, then
+ a. Let result be Call(exoticToPrim, input, «hint»).
+ b. ReturnIfAbrupt(result).
+features: [Symbol.toPrimitive]
+---*/
+
+var thrower = {};
+var counter = {};
+var log;
+
+Object.defineProperty(thrower, Symbol.toPrimitive, {
+ get: function() {
+ log += 'accessThrower';
+ return function() { throw new Test262Error(); };
+ }
+});
+Object.defineProperty(counter, Symbol.toPrimitive, {
+ get: function() {
+ log += 'accessCounter';
+ return function() { log += 'callCounter'; };
+ }
+});
+
+log = '';
+
+assert.throws(Test262Error, function() {
+ thrower + counter;
+}, 'error thrown by left-hand side');
+assert.sameValue(log, 'accessThrower');
+
+log = '';
+
+assert.throws(Test262Error, function() {
+ counter + thrower;
+}, 'error thrown by right-hand side');
+assert.sameValue(log, 'accessCountercallCounteraccessThrower');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-invocation.js b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-invocation.js
new file mode 100644
index 0000000000..8e84913f02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-invocation.js
@@ -0,0 +1,61 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+es6id: 12.7.3.1
+description: Invocation of `Symbol.toPrimitive` method during coercion
+info: |
+ [...]
+ 5. Let lprim be ? ToPrimitive(lval).
+ 6. Let rprim be ? ToPrimitive(rval).
+ [...]
+
+ ES6 Section 7.2.12 Abstract Equality Comparison
+
+ [...]
+ 10. If Type(x) is either String, Number, or Symbol and Type(y) is Object,
+ then return the result of the comparison x == ToPrimitive(y).
+
+ ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
+
+ 1. If PreferredType was not passed, let hint be "default".
+ [...]
+ 4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
+ 5. ReturnIfAbrupt(exoticToPrim).
+ 6. If exoticToPrim is not undefined, then
+ a. Let result be Call(exoticToPrim, input, «hint»).
+ [...]
+features: [Symbol.toPrimitive]
+---*/
+
+var left = {};
+var right = {};
+var log = '';
+var leftThisVal, rightThisVal, leftArgs, rightArgs;
+
+left[Symbol.toPrimitive] = function() {
+ log += 'left';
+ leftThisVal = this;
+ leftArgs = arguments;
+};
+
+right[Symbol.toPrimitive] = function() {
+ log += 'right';
+ rightThisVal = this;
+ rightArgs = arguments;
+};
+
+
+left + right;
+
+assert.sameValue(log, 'leftright', 'methods invoked in correct sequence');
+
+assert.sameValue(leftThisVal, left, 'left-hand side `this` value');
+assert.sameValue(leftArgs.length, 1, 'left-hand side argument length');
+assert.sameValue(leftArgs[0], 'default', 'left-hand side argument value');
+
+assert.sameValue(rightThisVal, right, 'right-hand side `this` value');
+assert.sameValue(rightArgs.length, 1, 'right-hand side argument length');
+assert.sameValue(rightArgs[0], 'default', 'right-hand side argument value');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-obj.js b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-obj.js
new file mode 100644
index 0000000000..e09ff50bf4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-obj.js
@@ -0,0 +1,50 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+es6id: 12.7.3.1
+description: >
+ Behavior when coercion via `Symbol.toPrimitive` yields an Object
+info: |
+ [...]
+ 5. Let lprim be ? ToPrimitive(lval).
+ 6. Let rprim be ? ToPrimitive(rval).
+ [...]
+
+ ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
+
+ [...]
+ 4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
+ 5. ReturnIfAbrupt(exoticToPrim).
+ 6. If exoticToPrim is not undefined, then
+ a. Let result be Call(exoticToPrim, input, «hint»).
+ b. ReturnIfAbrupt(result).
+ c. If Type(result) is not Object, return result.
+ d. Throw a TypeError exception.
+features: [Symbol.toPrimitive]
+---*/
+
+var y = {};
+var retVal;
+
+y[Symbol.toPrimitive] = function() {
+ return retVal;
+};
+
+retVal = {};
+assert.throws(TypeError, function() {
+ 0 + y;
+}, 'ordinary object value, right-hand side');
+assert.throws(TypeError, function() {
+ y + 0;
+}, 'ordinary object value, left-hand side');
+
+retVal = (function() { return arguments; }());
+assert.throws(TypeError, function() {
+ 0 + y;
+}, 'arguments exotic object value, right-hand side');
+assert.throws(TypeError, function() {
+ y + 0;
+}, 'arguments exotic object value, left-hand side');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-prim.js b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-prim.js
new file mode 100644
index 0000000000..ad4d2d24ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/coerce-symbol-to-prim-return-prim.js
@@ -0,0 +1,66 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+es6id: 12.7.3.1
+description: >
+ Behavior when coercion via `Symbol.toPrimitive` yields a primitive value
+info: |
+ [...]
+ 5. Let lprim be ? ToPrimitive(lval).
+ 6. Let rprim be ? ToPrimitive(rval).
+ 7. If Type(lprim) is String or Type(rprim) is String, then
+ a. Let lstr be ? ToString(lprim).
+ b. Let rstr be ? ToString(rprim).
+ c. Return the String that is the result of concatenating lstr and rstr.
+ 8. Let lnum be ? ToNumber(lprim).
+ 9. Let rnum be ? ToNumber(rprim).
+ 10. Return the result of applying the addition operation to lnum and rnum.
+ See the Note below 12.8.5.
+
+ ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
+
+ [...]
+ 4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
+ 5. ReturnIfAbrupt(exoticToPrim).
+ 6. If exoticToPrim is not undefined, then
+ a. Let result be Call(exoticToPrim, input, «hint»).
+ b. ReturnIfAbrupt(result).
+ c. If Type(result) is not Object, return result.
+features: [Symbol.toPrimitive]
+---*/
+
+var y = {};
+var retVal;
+
+y[Symbol.toPrimitive] = function() {
+ return retVal;
+};
+
+retVal = 86;
+assert.sameValue(1 + y, 87);
+assert.sameValue(y + 2, 88);
+assert.sameValue('s' + y, 's86');
+assert.sameValue(y + 's', '86s');
+
+retVal = 'str';
+assert.sameValue(0 + y, '0str');
+assert.sameValue(y + 0, 'str0');
+assert.sameValue('s' + y, 'sstr');
+assert.sameValue(y + 's', 'strs');
+
+retVal = Symbol.toPrimitive;
+assert.throws(TypeError, function() {
+ 0 + y;
+}, 'ToNumber(Symbol): right-hand side');
+assert.throws(TypeError, function() {
+ y + 0;
+}, 'ToNumber(Symbol): left-hand side');
+assert.throws(TypeError, function() {
+ '' + y;
+}, 'ToString(Symbol): right-hand side');
+assert.throws(TypeError, function() {
+ y + '';
+}, 'ToString(Symbol): left-hand size');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/get-symbol-to-prim-err.js b/js/src/tests/test262/language/expressions/addition/get-symbol-to-prim-err.js
new file mode 100644
index 0000000000..00fadaa04a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/get-symbol-to-prim-err.js
@@ -0,0 +1,53 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+es6id: 12.7.3.1
+description: >
+ Behavior when error is thrown while accessing `Symbol.toPrimitive` property
+info: |
+ [...]
+ 5. Let lprim be ? ToPrimitive(lval).
+ 6. Let rprim be ? ToPrimitive(rval).
+ [...]
+
+ ES6 Section 7.1.1 ToPrimitive ( input [, PreferredType] )
+
+ 1. If PreferredType was not passed, let hint be "default".
+ [...]
+ 4. Let exoticToPrim be GetMethod(input, @@toPrimitive).
+ 5. ReturnIfAbrupt(exoticToPrim).
+ 6. If exoticToPrim is not undefined, then
+ a. Let result be Call(exoticToPrim, input, «hint»).
+ [...]
+features: [Symbol.toPrimitive]
+---*/
+
+var thrower = {};
+var counter = {};
+var callCount = 0;
+
+Object.defineProperty(thrower, Symbol.toPrimitive, {
+ get: function() {
+ throw new Test262Error();
+ }
+});
+Object.defineProperty(counter, Symbol.toPrimitive, {
+ get: function() {
+ callCount += 1;
+ }
+});
+
+assert.throws(Test262Error, function() {
+ thrower + counter;
+}, 'error from property access of left-hand side');
+
+assert.sameValue(callCount, 0);
+
+assert.throws(Test262Error, function() {
+ counter + thrower;
+}, 'error from property access of right-hand side');
+
+assert.sameValue(callCount, 1);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/order-of-evaluation.js b/js/src/tests/test262/language/expressions/addition/order-of-evaluation.js
new file mode 100644
index 0000000000..abe4f32ebb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/order-of-evaluation.js
@@ -0,0 +1,142 @@
+// Copyright (C) 2018 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus-runtime-semantics-evaluation
+description: Type coercion order of operations for addition operator
+features: [Symbol]
+info: |
+ Evaluate lhs
+ Evaluate rhs
+ ToPrimitive(lhs)
+ ToPrimitive(rhs)
+ ToNumeric(lhs)
+ ToNumeric(rhs)
+---*/
+
+function MyError() {}
+var trace;
+
+// ?GetValue(lhs) throws.
+trace = "";
+assert.throws(MyError, function() {
+ (function() {
+ trace += "1";
+ throw new MyError();
+ })() + (function() {
+ trace += "2";
+ throw new Test262Error("should not be evaluated");
+ })();
+}, "?GetValue(lhs) throws.");
+assert.sameValue(trace, "1", "?GetValue(lhs) throws.");
+
+// ?GetValue(rhs) throws.
+trace = "";
+assert.throws(MyError, function() {
+ (function() {
+ trace += "1";
+ return {
+ valueOf: function() {
+ trace += "3";
+ throw new Test262Error("should not be evaluated");
+ }
+ };
+ })() + (function() {
+ trace += "2";
+ throw new MyError();
+ })();
+}, "?GetValue(rhs) throws.");
+assert.sameValue(trace, "12", "?GetValue(rhs) throws.");
+
+// ?ToPrimive(lhs) throws.
+trace = "";
+assert.throws(MyError, function() {
+ (function() {
+ trace += "1";
+ return {
+ valueOf: function() {
+ trace += "3";
+ throw new MyError();
+ }
+ };
+ })() + (function() {
+ trace += "2";
+ return {
+ valueOf: function() {
+ trace += "4";
+ throw new Test262Error("should not be evaluated");
+ }
+ };
+ })();
+}, "?ToPrimive(lhs) throws.");
+assert.sameValue(trace, "123", "?ToPrimive(lhs) throws.");
+
+// ?ToPrimive(rhs) throws.
+trace = "";
+assert.throws(MyError, function() {
+ (function() {
+ trace += "1";
+ return {
+ valueOf: function() {
+ trace += "3";
+ return 1;
+ }
+ };
+ })() + (function() {
+ trace += "2";
+ return {
+ valueOf: function() {
+ trace += "4";
+ throw new MyError();
+ }
+ };
+ })();
+}, "?ToPrimive(rhs) throws.");
+assert.sameValue(trace, "1234", "?ToPrimive(rhs) throws.");
+
+// ?ToPrimive(rhs) is called before ?ToNumeric(lhs).
+trace = "";
+assert.throws(MyError, function() {
+ (function() {
+ trace += "1";
+ return {
+ valueOf: function() {
+ trace += "3";
+ return Symbol("1");
+ }
+ };
+ })() + (function() {
+ trace += "2";
+ return {
+ valueOf: function() {
+ trace += "4";
+ throw new MyError();
+ }
+ };
+ })();
+}, "?ToPrimive(rhs) is called before ?ToNumeric(lhs).");
+assert.sameValue(trace, "1234", "?ToPrimive(rhs) is called before ?ToNumeric(lhs).");
+
+// GetValue(lhs) throws.
+trace = "";
+assert.throws(TypeError, function() {
+ (function() {
+ trace += "1";
+ return {
+ valueOf: function() {
+ trace += "3";
+ return 1;
+ }
+ };
+ })() + (function() {
+ trace += "2";
+ return {
+ valueOf: function() {
+ trace += "4";
+ return Symbol("1");
+ }
+ };
+ })();
+}, "GetValue(lhs) throws.");
+assert.sameValue(trace, "1234", "GetValue(lhs) throws.");
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/addition/shell.js b/js/src/tests/test262/language/expressions/addition/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/shell.js
diff --git a/js/src/tests/test262/language/expressions/addition/symbol-to-string.js b/js/src/tests/test262/language/expressions/addition/symbol-to-string.js
new file mode 100644
index 0000000000..390f37c051
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/addition/symbol-to-string.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2013 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-addition-operator-plus
+es6id: 12.7.3
+description: Symbol value cannot be converted to a String
+info: |
+ [...]
+ 7. If Type(lprim) is String or Type(rprim) is String, then
+ a. Let lstr be ? ToString(lprim).
+features: [Symbol]
+---*/
+
+var s = Symbol('66');
+assert.throws(TypeError, function() {
+ s + '';
+});
+
+reportCompare(0, 0);