diff options
Diffstat (limited to 'js/src/tests/test262/ch11/11.9')
110 files changed, 3926 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A1.js new file mode 100644 index 000000000..3f9904f46 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A1.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * White Space and Line Terminator between EqualityExpression and "==" or between "==" and RelationalExpression are allowed + * + * @path ch11/11.9/11.9.1/S11.9.1_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("true\u0009==\u00091") !== true) { + $ERROR('#1: (true\\u0009==\\u00091) === true'); +} + +//CHECK#2 +if (eval("true\u000B==\u000B1") !== true) { + $ERROR('#2: (true\\u000B==\\u000B1) === true'); +} + +//CHECK#3 +if (eval("true\u000C==\u000C1") !== true) { + $ERROR('#3: (true\\u000C==\\u000C1) === true'); +} + +//CHECK#4 +if (eval("true\u0020==\u00201") !== true) { + $ERROR('#4: (true\\u0020==\\u00201) === true'); +} + +//CHECK#5 +if (eval("true\u00A0==\u00A01") !== true) { + $ERROR('#5: (true\\u00A0==\\u00A01) === true'); +} + +//CHECK#6 +if (eval("true\u000A==\u000A1") !== true) { + $ERROR('#6: (true\\u000A==\\u000A1) === true'); +} + +//CHECK#7 +if (eval("true\u000D==\u000D1") !== true) { + $ERROR('#7: (true\\u000D==\\u000D1) === true'); +} + +//CHECK#8 +if (eval("true\u2028==\u20281") !== true) { + $ERROR('#8: (true\\u2028==\\u20281) === true'); +} + +//CHECK#9 +if (eval("true\u2029==\u20291") !== true) { + $ERROR('#9: (true\\u2029==\\u20291) === true'); +} + +//CHECK#10 +if (eval("true\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029==\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291") !== true) { + $ERROR('#10: (true\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029==\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_T1.js new file mode 100644 index 000000000..2d59985ae --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.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. + +/** + * Operator x == y uses GetValue + * + * @path ch11/11.9/11.9.1/S11.9.1_A2.1_T1.js + * @description Either Type is not Reference or GetBase is not null + */ + +//CHECK#1 +if ((1 == 1) !== true) { + $ERROR('#1: (1 == 1) === true'); +} + +//CHECK#2 +var x = 1; +if ((x == 1) !== true) { + $ERROR('#2: var x = 1; (x == 1) === true'); +} + +//CHECK#3 +var y = 1; +if ((1 == y) !== true) { + $ERROR('#3: var y = 1; (1 == y) === true'); +} + +//CHECK#4 +var x = 1; +var y = 1; +if ((x == y) !== true) { + $ERROR('#4: var x = 1; var y = 1; (x == y) === true'); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objectx.prop = 1; +objecty.prop = 1; +if ((objectx.prop == objecty.prop) !== true) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop == objecty.prop) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_T2.js new file mode 100644 index 000000000..21994ea8b --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_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. + +/** + * Operator x == y uses GetValue + * + * @path ch11/11.9/11.9.1/S11.9.1_A2.1_T2.js + * @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)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_T3.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_T3.js new file mode 100644 index 000000000..0f8b2c378 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.1_T3.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. + +/** + * Operator x == y uses GetValue + * + * @path ch11/11.9/11.9.1/S11.9.1_A2.1_T3.js + * @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)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T1.js new file mode 100644 index 000000000..04d461dcb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.1/S11.9.1_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var x = 0; +if (((x = 1) == x) !== true) { + $ERROR('#1: var x = 0; ((x = 1) == x) === true'); +} + +//CHECK#2 +var x = 0; +if ((x == (x = 1)) !== false) { + $ERROR('#2: var x = 0; (x == (x = 1)) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T2.js new file mode 100644 index 000000000..fdfc3fc92 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.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. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.1/S11.9.1_A2.4_T2.js + * @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)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T3.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T3.js new file mode 100644 index 000000000..eecdc35aa --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A2.4_T3.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.1/S11.9.1_A2.4_T3.js + * @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)); + } +} + +//CHECK#2 +if (((y = 1) == y) !== true) { + $ERROR('#2: ((y = 1) == y) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.1.js new file mode 100644 index 000000000..f54158976 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Return true, if x and y are both true or both false; otherwise, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A3.1.js + * @description x and y are boolean primitives + */ + +//CHECK#1 +if ((true == true) !== true) { + $ERROR('#1: (true == true) === true'); +} + +//CHECK#2 +if ((false == false) !== true) { + $ERROR('#2: (false == false) === true'); +} + +//CHECK#3 +if ((true == false) !== false) { + $ERROR('#3: (true == false) === false'); +} + +//CHECK#4 +if ((false == true) !== false) { + $ERROR('#4: (false == true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.2.js new file mode 100644 index 000000000..d64e86948 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.2.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. + +/** + * If Type(x) is Boolean and Type(y) is Number, + * return the result of comparison ToNumber(x) == y + * + * @path ch11/11.9/11.9.1/S11.9.1_A3.2.js + * @description x is primitive boolean, y is primitive number + */ + +//CHECK#1 +if ((true == 1) !== true) { + $ERROR('#1: (true == 1) === true'); +} + +//CHECK#2 +if ((false == "0") !== true) { + $ERROR('#2: (false == "0") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.3.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.3.js new file mode 100644 index 000000000..342c6f961 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A3.3.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. + +/** + * If Type(y) is Number and Type(y) is Boolean, + * return the result of comparison x == ToNumber(y) + * + * @path ch11/11.9/11.9.1/S11.9.1_A3.3.js + * @description x is primitive number, y is primitive boolean + */ + +//CHECK#1 +if ((0 == false) !== true) { + $ERROR('#1: (0 == false) === true'); +} + +//CHECK#2 +if (("1" == true) !== true) { + $ERROR('#2: ("1" == true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.1_T1.js new file mode 100644 index 000000000..2e5b4738a --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.1_T1.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. + +/** + * If x or y is NaN, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A4.1_T1.js + * @description x is NaN + */ + +//CHECK#1 +if ((Number.NaN == true) !== false) { + $ERROR('#1: (NaN == true) === false'); +} + +//CHECK#2 +if ((Number.NaN == 1) !== false) { + $ERROR('#2: (NaN == 1) === false'); +} + +//CHECK#3 +if ((Number.NaN == Number.NaN) !== false) { + $ERROR('#3: (NaN == NaN) === false'); +} + +//CHECK#4 +if ((Number.NaN == Number.POSITIVE_INFINITY) !== false) { + $ERROR('#4: (NaN == +Infinity) === false'); +} + +//CHECK#5 +if ((Number.NaN == Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#5: (NaN == -Infinity) === false'); +} + +//CHECK#6 +if ((Number.NaN == Number.MAX_VALUE) !== false) { + $ERROR('#6: (NaN == Number.MAX_VALUE) === false'); +} + +//CHECK#7 +if ((Number.NaN == Number.MIN_VALUE) !== false) { + $ERROR('#7: (NaN == Number.MIN_VALUE) === false'); +} + +//CHECK#8 +if ((Number.NaN == "string") !== false) { + $ERROR('#8: (NaN == "string") === false'); +} + +//CHECK#9 +if ((Number.NaN == new Object()) !== false) { + $ERROR('#9: (NaN == new Object()) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.1_T2.js new file mode 100644 index 000000000..8d3be41d2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.1_T2.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. + +/** + * If x or y is NaN, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A4.1_T2.js + * @description y is NaN + */ + +//CHECK#1 +if ((true == Number.NaN) !== false) { + $ERROR('#1: (true == NaN) === false'); +} + +//CHECK#2 +if ((-1 == Number.NaN) !== false) { + $ERROR('#2: (-1 == NaN) === false'); +} + +//CHECK#3 +if ((Number.NaN == Number.NaN) !== false) { + $ERROR('#3: (NaN == NaN) === false'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY == Number.NaN) !== false) { + $ERROR('#4: (+Infinity == NaN) === false'); +} + +//CHECK#5 +if ((Number.NEGATIVE_INFINITY == Number.NaN) !== false) { + $ERROR('#5: (-Infinity == NaN) === false'); +} + +//CHECK#6 +if ((Number.MAX_VALUE == Number.NaN) !== false) { + $ERROR('#6: (Number.MAX_VALUE == NaN) === false'); +} + +//CHECK#7 +if ((Number.MIN_VALUE == Number.NaN) !== false) { + $ERROR('#7: (Number.MIN_VALUE == NaN) === false'); +} + +//CHECK#8 +if (("string" == Number.NaN) !== false) { + $ERROR('#8: ("string" == NaN) === false'); +} + +//CHECK#9 +if ((new Object() == Number.NaN) !== false) { + $ERROR('#9: (new Object() == NaN) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.2.js new file mode 100644 index 000000000..b7e26344d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.2.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +0(-0) and y is -0(+0), return true + * + * @path ch11/11.9/11.9.1/S11.9.1_A4.2.js + * @description Checking all combinations + */ + +//CHECK#1 +if ((+0 == -0) !== true) { + $ERROR('#1: (+0 == -0) === true'); +} + +//CHECK#2 +if ((-0 == +0) !== true) { + $ERROR('#2: (-0 == +0) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.3.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.3.js new file mode 100644 index 000000000..b888b280c --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A4.3.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are Number-s minus NaN, +0, -0. + * Return true, if x is the same number value as y; otherwise, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A4.3.js + * @description x and y are primitive numbers + */ + +//CHECK#1 +if ((Number.POSITIVE_INFINITY == Number.POSITIVE_INFINITY) !== true) { + $ERROR('#1: (+Infinity == +Infinity) === true'); +} + +//CHECK#2 +if ((Number.NEGATIVE_INFINITY == Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#2: (-Infinity == -Infinity) === true'); +} + +//CHECK#3 +if ((Number.POSITIVE_INFINITY == -Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#3: (+Infinity == -(-Infinity)) === true'); +} + +//CHECK#4 +if ((1 == 0.999999999999) !== false) { + $ERROR('#4: (1 == 0.999999999999) === false'); +} + +//CHECK#5 +if ((1.0 == 1) !== true) { + $ERROR('#5: (1.0 == 1) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.1.js new file mode 100644 index 000000000..26ba2d50d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.1.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. + +/** + * Type(x) and Type(y) are String-s. + * Return true, if x and y are exactly the same sequence of characters; otherwise, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A5.1.js + * @description x and y are primitive string + */ + +//CHECK#1 +if (("" == "") !== true) { + $ERROR('#1: ("" == "") === true'); +} + +//CHECK#2 +if ((" " == " ") !== true) { + $ERROR('#2: " (" == " ") === true'); +} + +//CHECK#3 +if ((" " == "") !== false) { + $ERROR('#3: " (" == "") === false'); +} + +//CHECK#4 +if (("string" == "string") !== true) { + $ERROR('#4: ("string" == "string") === true'); +} + +//CHECK#5 +if ((" string" == "string ") !== false) { + $ERROR('#5: (" string" == "string ") === false'); +} + +//CHECK#6 +if (("1.0" == "1") !== false) { + $ERROR('#6: ("1.0" == "1") === false'); +} + +//CHECK#7 +if (("0xff" == "255") !== false) { + $ERROR('#7: ("0xff" == "255") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.2.js new file mode 100644 index 000000000..a6464a519 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.2.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is Number and Type(y) is String, + * return the result of comparison x == ToNumber(y) + * + * @path ch11/11.9/11.9.1/S11.9.1_A5.2.js + * @description x is primitive number, y is primitive string + */ + +//CHECK#1 +if ((1 == "1") !== true) { + $ERROR('#1: (1 == "1") === true'); +} + +//CHECK#2 +if ((1.100 == "+1.10") !== true) { + $ERROR('#2: (1.100 == "+1.10") === true'); +} + +//CHECK#3 +if ((1 == "true") !== false) { + $ERROR('#3: (1 == "true") === false'); +} + +//CHECK#4 +if ((255 == "0xff") !== true) { + $ERROR('#4: (255 == "0xff") === true'); +} + +//CHECK#5 +if ((0 == "") !== true) { + $ERROR('#5: (0 == "") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.3.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.3.js new file mode 100644 index 000000000..7fb95cf74 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A5.3.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is String and Type(y) is Number, + * return the result of comparison ToNumber(x) == y + * + * @path ch11/11.9/11.9.1/S11.9.1_A5.3.js + * @description x is primitive string, y is primitive number + */ + +//CHECK#1 +if (("-1" == -1) !== true) { + $ERROR('#1: ("-1" == -1) === true'); +} + +//CHECK#2 +if (("-1.100" == -1.10) !== true) { + $ERROR('#2: ("-1.100" == -1.10) === true'); +} + +//CHECK#3 +if (("false" == 0) !== false) { + $ERROR('#3: ("false" == 0) === false'); +} + +//CHECK#4 +if (("5e-324" == 5e-324) !== true) { + $ERROR('#4: ("5e-324" == 5e-324) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.1.js new file mode 100644 index 000000000..95e8b80d7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.1.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) as well as Type(y) is undefined or null, return true + * + * @path ch11/11.9/11.9.1/S11.9.1_A6.1.js + * @description Checking all combinations + */ + +//CHECK#1 +if ((undefined == undefined) !== true) { + $ERROR('#1: (undefined == undefined) === true'); +} + +//CHECK#2 +if ((void 0 == undefined) !== true) { + $ERROR('#2: (void 0 == undefined) === true'); +} + +//CHECK#3 +if ((undefined == eval("var x")) !== true) { + $ERROR('#3: (undefined == eval("var x")) === true'); +} + +//CHECK#4 +if ((undefined == null) !== true) { + $ERROR('#4: (undefined == null) === true'); +} + +//CHECK#5 +if ((null == void 0) !== true) { + $ERROR('#5: (null == void 0) === true'); +} + +//CHECK#6 +if ((null == null) !== true) { + $ERROR('#6: (null == null) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.2_T1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.2_T1.js new file mode 100644 index 000000000..4dcf84051 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.2_T1.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. + +/** + * If one expression is undefined or null and another is not, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A6.2_T1.js + * @description x is null or undefined, y is not + */ + +//CHECK#1 +if ((undefined == true) !== false) { + $ERROR('#1: (undefined == true) === false'); +} + +//CHECK#2 +if ((undefined == 0) !== false) { + $ERROR('#2: (undefined == 0) === false'); +} + +//CHECK#3 +if ((undefined == "undefined") !== false) { + $ERROR('#3: (undefined == "undefined") === false'); +} + +//CHECK#4 +if ((undefined == {}) !== false) { + $ERROR('#4: (undefined == {}) === false'); +} + +//CHECK#5 +if ((null == false) !== false) { + $ERROR('#5: (null == false) === false'); +} + +//CHECK#6 +if ((null == 0) !== false) { + $ERROR('#6: (null == 0) === false'); +} + +//CHECK#7 +if ((null == "null") !== false) { + $ERROR('#7: (null == "null") === false'); +} + +//CHECK#8 +if ((null == {}) !== false) { + $ERROR('#8: (null == {}) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.2_T2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.2_T2.js new file mode 100644 index 000000000..6f5f2ac70 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A6.2_T2.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. + +/** + * If one expression is undefined or null and another is not, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A6.2_T2.js + * @description y is null or undefined, x is not + */ + +//CHECK#1 +if ((false == undefined) !== false) { + $ERROR('#1: (false == undefined) === false'); +} + +//CHECK#2 +if ((Number.NaN == undefined) !== false) { + $ERROR('#2: (Number.NaN == undefined) === false'); +} + +//CHECK#3 +if (("undefined" == undefined) !== false) { + $ERROR('#3: ("undefined" == undefined) === false'); +} + +//CHECK#4 +if (({} == undefined) !== false) { + $ERROR('#4: ({} == undefined) === false'); +} + +//CHECK#5 +if ((false == null) !== false) { + $ERROR('#5: (false == null) === false'); +} + +//CHECK#6 +if ((0 == null) !== false) { + $ERROR('#6: (0 == null) === false'); +} + +//CHECK#7 +if (("null" == null) !== false) { + $ERROR('#7: ("null" == null) === false'); +} + +//CHECK#8 +if (({} == null) !== false) { + $ERROR('#8: ({} == null) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.1.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.1.js new file mode 100644 index 000000000..b2f0d23a7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.1.js @@ -0,0 +1,53 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are Object-s. + * Return true, if x and y are references to the same Object; otherwise, return false + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.1.js + * @description Checking Boolean object, Number object, String object, Object object + */ + +//CHECK#1 +if ((new Boolean(true) == new Boolean(true)) !== false) { + $ERROR('#1: (new Boolean(true) == new Boolean(true)) === false'); +} + +//CHECK#2 +if ((new Number(1) == new Number(1)) !== false) { + $ERROR('#2: (new Number(1) == new Number(1)) === false'); +} + +//CHECK#3 +if ((new String("x") == new String("x")) !== false) { + $ERROR('#3: (new String("x") == new String("x")) === false'); +} + +//CHECK#4 +if ((new Object() == new Object()) !== false) { + $ERROR('#4: (new Object() == new Object()) === false'); +} + +//CHECK#5 +x = {}; +y = x; +if ((x == y) !== true) { + $ERROR('#5: x = {}; y = x; (x == y) === true'); +} + +//CHECK#6 +if ((new Boolean(true) == new Number(1)) !== false) { + $ERROR('#6 (new Boolean(true) == new Number(1)) === false'); +} + +//CHECK#7 +if ((new Number(1) == new String("1")) !== false) { + $ERROR('#7: (new Number(1) == new String("1")) === false'); +} + +//CHECK#8 +if ((new String("1") == new Boolean(true)) !== false) { + $ERROR('#8: (new String("x") == new Boolean(true)) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.2.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.2.js new file mode 100644 index 000000000..5704688ae --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.2.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. + +/** + * If Type(x) is Object and Type(y) is Boolean, + * return ToPrimitive(x) == y + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.2.js + * @description x is object, y is primitive boolean + */ + +//CHECK#1 +if ((new Boolean(true) == true) !== true) { + $ERROR('#1: (new Boolean(true) == true) === true'); +} + +//CHECK#2 +if ((new Number(1) == true) !== true) { + $ERROR('#2: (new Number(1) == true) === true'); +} + +//CHECK#3 +if ((new String("1") == true) !== true) { + $ERROR('#3: (new String("1") == true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.3.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.3.js new file mode 100644 index 000000000..c0c89cea0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.3.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. + +/** + * If Type(x) is Boolean and Type(y) is Object, + * return x == ToPrimitive(y) + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.3.js + * @description y is object, x is primitive boolean + */ + +//CHECK#1 +if ((true == new Boolean(true)) !== true) { + $ERROR('#1: (true == new Boolean(true)) === true'); +} + +//CHECK#2 +if ((true == new Number(1)) !== true) { + $ERROR('#2: (true == new Number(1)) === true'); +} + +//CHECK#3 +if ((true == new String("+1")) !== true) { + $ERROR('#3: (true == new String("+1")) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.4.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.4.js new file mode 100644 index 000000000..65ce2df60 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.4.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. + +/** + * If Type(x) is Object and Type(y) is Number, + * return ToPrimitive(x) == y + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.4.js + * @description x is object, y is primitive number + */ + +//CHECK#1 +if ((new Boolean(true) == 1) !== true) { + $ERROR('#1: (new Boolean(true) == 1) === true'); +} + +//CHECK#2 +if ((new Number(-1) == -1) !== true) { + $ERROR('#2: (new Number(-1) == -1) === true'); +} + +//CHECK#3 +if ((new String("-1") == -1) !== true) { + $ERROR('#3: (new String("-1") == -1) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.5.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.5.js new file mode 100644 index 000000000..87cbe6eed --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.5.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. + +/** + * If Type(x) is Number and Type(y) is Object, + * return x == ToPrimitive(y) + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.5.js + * @description y is object, x is primitive number + */ + +//CHECK#1 +if ((1 == new Boolean(true)) !== true) { + $ERROR('#1: (1 == new Boolean(true)) === true'); +} + +//CHECK#2 +if ((-1 == new Number(-1)) !== true) { + $ERROR('#2: (-1 == new Number(-1)) === true'); +} + +//CHECK#3 +if ((-1 == new String("-1")) !== true) { + $ERROR('#3: (-1 == new String("-1")) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.6.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.6.js new file mode 100644 index 000000000..986f66b90 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.6.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. + +/** + * If Type(x) is Object and Type(y) is String, + * return ToPrimitive(x) == y + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.6.js + * @description x is object, y is primitive string + */ + +//CHECK#1 +if ((new Boolean(true) == "1") !== true) { + $ERROR('#1: (new Boolean(true) == "1") === true'); +} + +//CHECK#2 +if ((new Number(-1) == "-1") !== true) { + $ERROR('#2: (new Number(-1) == "-1") === true'); +} + +//CHECK#3 +if ((new String("x") == "x") !== true) { + $ERROR('#3: (new String("x") == "x") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.7.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.7.js new file mode 100644 index 000000000..4d8412d30 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.7.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. + +/** + * If Type(x) is String and Type(y) is Object, + * return x == ToPrimitive(y) + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.7.js + * @description y is object, x is primitive string + */ + +//CHECK#1 +if (("1" == new Boolean(true)) !== true) { + $ERROR('#1: ("1" == new Boolean(true)) === true'); +} + +//CHECK#2 +if (("-1" == new Number(-1)) !== true) { + $ERROR('#2: ("-1" == new Number(-1)) === true'); +} + +//CHECK#3 +if (("x" == new String("x")) !== true) { + $ERROR('#3: ("x" == new String("x")) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.8.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.8.js new file mode 100644 index 000000000..9aa54434e --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.8.js @@ -0,0 +1,76 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is Object and Type(y) is primitive type, + * return ToPrimitive(x) == y + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.8.js + * @description x is object, y is primtitive + */ + +//CHECK#1 +if (({valueOf: function() {return 1}} == true) !== true) { + $ERROR('#1: ({valueOf: function() {return 1}} == true) === true'); +} + +//CHECK#2 +if (({valueOf: function() {return 1}, toString: function() {return 0}} == 1) !== true) { + $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} == 1) === true'); +} + +//CHECK#3 +if (({valueOf: function() {return 1}, toString: function() {return {}}} == "+1") !== true) { + $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} == "+1") === true'); +} + +//CHECK#4 +try { + if (({valueOf: function() {return "+1"}, toString: function() {throw "error"}} == true) !== true) { + $ERROR('#4.1: ({valueOf: function() {return "+1"}, toString: function() {throw "error"}} == true) === true'); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: ({valueOf: function() {return "+1"}, toString: function() {throw "error"}} == true) not throw "error"'); + } else { + $ERROR('#4.3: ({valueOf: function() {return "+1"}, toString: function() {throw "error"}} == true) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if (({toString: function() {return "+1"}} == 1) !== true) { + $ERROR('#5: ({toString: function() {return "+1"}} == 1) === true'); +} + +//CHECK#6 +if (({valueOf: function() {return {}}, toString: function() {return "+1"}} == "1") !== false) { + $ERROR('#6.1: ({valueOf: function() {return {}}, toString: function() {return "+1"}} == "1") === false'); +} else { + if (({valueOf: function() {return {}}, toString: function() {return "+1"}} == "+1") !== true) { + $ERROR('#6.2: ({valueOf: function() {return {}}, toString: function() {return "+1"}} == "+1") === true'); + } +} + +//CHECK#7 +try { + ({valueOf: function() {throw "error"}, toString: function() {return 1}} == 1); + $ERROR('#7.1: ({valueOf: function() {throw "error"}, toString: function() {return 1}} == 1) throw "error". Actual: ' + (({valueOf: function() {throw "error"}, toString: function() {return 1}} == 1))); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: ({valueOf: function() {throw "error"}, toString: function() {return 1}} == 1) throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + ({valueOf: function() {return {}}, toString: function() {return {}}} == 1); + $ERROR('#8.1: ({valueOf: function() {return {}}, toString: function() {return {}}} == 1) throw TypeError. Actual: ' + (({valueOf: function() {return {}}, toString: function() {return {}}} == 1))); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: ({valueOf: function() {return {}}, toString: function() {return {}}} == 1) throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.9.js b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.9.js new file mode 100644 index 000000000..ba4d0f38d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/S11.9.1_A7.9.js @@ -0,0 +1,76 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is primitive type and Type(y) is Object, + * return x == ToPrimitive(y) + * + * @path ch11/11.9/11.9.1/S11.9.1_A7.9.js + * @description y is object, x is primtitive + */ + +//CHECK#1 +if ((true == {valueOf: function() {return 1}}) !== true) { + $ERROR('#1: (true == {valueOf: function() {return 1}}) === true'); +} + +//CHECK#2 +if ((1 == {valueOf: function() {return 1}, toString: function() {return 0}}) !== true) { + $ERROR('#2: (1 == {valueOf: function() {return 1}, toString: function() {return 0}}) === true'); +} + +//CHECK#3 +if (("+1" == {valueOf: function() {return 1}, toString: function() {return {}}}) !== true) { + $ERROR('#3: ("+1" == {valueOf: function() {return 1}, toString: function() {return {}}}) === true'); +} + +//CHECK#4 +try { + if ((true == {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) !== true) { + $ERROR('#4.1: (true == {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) === true'); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: (true == {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) not throw "error"'); + } else { + $ERROR('#4.3: (true == {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if ((1 == {toString: function() {return "+1"}}) !== true) { + $ERROR('#5: (1 == {toString: function() {return "+1"}}) === true'); +} + +//CHECK#6 +if (("1" == {valueOf: function() {return {}}, toString: function() {return "+1"}}) !== false) { + $ERROR('#6.1: ("1" == {valueOf: function() {return {}}, toString: function() {return "+1"}}) === false'); +} else { + if (("+1" == {valueOf: function() {return {}}, toString: function() {return "+1"}}) !== true) { + $ERROR('#6.2: ("+1" == {valueOf: function() {return {}}, toString: function() {return "+1"}}) === true'); + } +} + +//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)); + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/browser.js b/js/src/tests/test262/ch11/11.9/11.9.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/browser.js diff --git a/js/src/tests/test262/ch11/11.9/11.9.1/shell.js b/js/src/tests/test262/ch11/11.9/11.9.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.1/shell.js diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A1.js new file mode 100644 index 000000000..5478e2d8c --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A1.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * White Space and Line Terminator between EqualityExpression and "!=" or between "!=" and RelationalExpression are allowed + * + * @path ch11/11.9/11.9.2/S11.9.2_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("true\u0009!=\u00091") !== false) { + $ERROR('#1: (true\\u0009!=\\u00091) === false'); +} + +//CHECK#2 +if (eval("true\u000B!=\u000B1") !== false) { + $ERROR('#2: (true\\u000B!=\\u000B1) === false'); +} + +//CHECK#3 +if (eval("true\u000C!=\u000C1") !== false) { + $ERROR('#3: (true\\u000C!=\\u000C1) === false'); +} + +//CHECK#4 +if (eval("true\u0020!=\u00201") !== false) { + $ERROR('#4: (true\\u0020!=\\u00201) === false'); +} + +//CHECK#5 +if (eval("true\u00A0!=\u00A01") !== false) { + $ERROR('#5: (true\\u00A0!=\\u00A01) === false'); +} + +//CHECK#6 +if (eval("true\u000A!=\u000A1") !== false) { + $ERROR('#6: (true\\u000A!=\\u000A1) === false'); +} + +//CHECK#7 +if (eval("true\u000D!=\u000D1") !== false) { + $ERROR('#7: (true\\u000D!=\\u000D1) === false'); +} + +//CHECK#8 +if (eval("true\u2028!=\u20281") !== false) { + $ERROR('#8: (true\\u2028!=\\u20281) === false'); +} + +//CHECK#9 +if (eval("true\u2029!=\u20291") !== false) { + $ERROR('#9: (true\\u2029!=\\u20291) === false'); +} + +//CHECK#10 +if (eval("true\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029!=\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291") !== false) { + $ERROR('#10: (true\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029!=\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_T1.js new file mode 100644 index 000000000..12b5bbe42 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_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. + +/** + * Operator x != y uses GetValue + * + * @path ch11/11.9/11.9.2/S11.9.2_A2.1_T1.js + * @description Either Type is not Reference or GetBase is not null + */ + +//CHECK#1 +if ((1 != 1) !== false) { + $ERROR('#1: (1 != 1) === false'); +} + +//CHECK#2 +var x = 1; +if ((x != 1) !== false) { + $ERROR('#2: var x = 1; (x != 1) === false'); +} + +//CHECK#3 +var y = 1; +if ((1 != y) !== false) { + $ERROR('#3: var y = 1; (1 != y) === false'); +} + +//CHECK#4 +var x = 1; +var y = 1; +if ((x != y) !== false) { + $ERROR('#4: var x = 1; var y = 1; (x != y) === false'); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objectx.prop = 1; +objecty.prop = 1; +if ((objectx.prop != objecty.prop) !== false) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; (objectx.prop != objecty.prop) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_T2.js new file mode 100644 index 000000000..aaf6f6a8c --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_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. + +/** + * Operator x != y uses GetValue + * + * @path ch11/11.9/11.9.2/S11.9.2_A2.1_T2.js + * @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)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_T3.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_T3.js new file mode 100644 index 000000000..f8e65a173 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.1_T3.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. + +/** + * Operator x != y uses GetValue + * + * @path ch11/11.9/11.9.2/S11.9.2_A2.1_T3.js + * @description If GetBase(y) is null, throw ReferenceError + */ + +//CHECK#1 +try { + 1 != y; + $ERROR('#1: 1 != y throw ReferenceError'); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: 1 != y throw ReferenceError. Actual: ' + (e)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T1.js new file mode 100644 index 000000000..5cb029e4f --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.2/S11.9.2_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var x = 0; +if (((x = 1) != x) !== false) { + $ERROR('#1: var x = 0; ((x = 1) != x) === false'); +} + +//CHECK#2 +var x = 0; +if ((x != (x = 1)) !== true) { + $ERROR('#2: var x = 0; (x != (x = 1)) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T2.js new file mode 100644 index 000000000..6570ee33b --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_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. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.2/S11.9.2_A2.4_T2.js + * @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)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T3.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T3.js new file mode 100644 index 000000000..93cde317e --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A2.4_T3.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.2/S11.9.2_A2.4_T3.js + * @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)); + } +} + +//CHECK#2 +if (((y = 1) != y) !== false) { + $ERROR('#2: ((y = 1) != y) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.1.js new file mode 100644 index 000000000..79921a295 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.1.js @@ -0,0 +1,30 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Return false, if x and y are both true or both false; otherwise, return true + * + * @path ch11/11.9/11.9.2/S11.9.2_A3.1.js + * @description x and y are boolean primitives + */ + +//CHECK#1 +if ((true != true) !== false) { + $ERROR('#1: (true != true) === false'); +} + +//CHECK#2 +if ((false != false) !== false) { + $ERROR('#2: (false != false) === false'); +} + +//CHECK#3 +if ((true != false) !== true) { + $ERROR('#3: (true != false) === true'); +} + +//CHECK#4 +if ((false != true) !== true) { + $ERROR('#4: (false != true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.2.js new file mode 100644 index 000000000..ff0f9c832 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.2.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is Boolean and Type(y) is Number, + * return the result of comparison ToNumber(x) != y + * + * @path ch11/11.9/11.9.2/S11.9.2_A3.2.js + * @description x is primitive boolean, y is primitive number + */ + +//CHECK#1 +if ((true != 1) !== false) { + $ERROR('#1: (true != 1) === false'); +} + +//CHECK#2 +if ((false != "0") !== false) { + $ERROR('#2: (false != "0") === false'); +} + +//CHECK#3 +if ((true != new Boolean(true)) !== false) { + $ERROR('#3: (true != new Boolean(true)) === false'); +} + +//CHECK#4 +if ((true != {valueOf: function () {return 1}}) !== false) { + $ERROR('#4: (true != {valueOf: function () {return 1}}) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.3.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.3.js new file mode 100644 index 000000000..b32bf7fbd --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A3.3.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(y) is Number and Type(y) is Boolean, + * return the result of comparison x != ToNumber(y) + * + * @path ch11/11.9/11.9.2/S11.9.2_A3.3.js + * @description x is primitive number, y is primitive boolean + */ + +//CHECK#1 +if ((0 != false) !== false) { + $ERROR('#1: (0 != false) === false'); +} + +//CHECK#2 +if (("1" != true) !== false) { + $ERROR('#2: ("1" != true) === false'); +} + +//CHECK#3 +if ((new Boolean(false) != false) !== false) { + $ERROR('#3: (new Boolean(false) != false) === false'); +} + +//CHECK#4 +if (({valueOf: function () {return "0"}} != false) !== false) { + $ERROR('#4: ({valueOf: function () {return "0"}} != false) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.1_T1.js new file mode 100644 index 000000000..98b9d074b --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.1_T1.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. + +/** + * If x or y is NaN, return true + * + * @path ch11/11.9/11.9.2/S11.9.2_A4.1_T1.js + * @description x is NaN + */ + +//CHECK#1 +if ((Number.NaN != true) !== true) { + $ERROR('#1: (NaN != true) === true'); +} + +//CHECK#2 +if ((Number.NaN != 1) !== true) { + $ERROR('#2: (NaN != 1) === true'); +} + +//CHECK#3 +if ((Number.NaN != Number.NaN) !== true) { + $ERROR('#3: (NaN != NaN) === true'); +} + +//CHECK#4 +if ((Number.NaN != Number.POSITIVE_INFINITY) !== true) { + $ERROR('#4: (NaN != +Infinity) === true'); +} + +//CHECK#5 +if ((Number.NaN != Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#5: (NaN != -Infinity) === true'); +} + +//CHECK#6 +if ((Number.NaN != Number.MAX_VALUE) !== true) { + $ERROR('#6: (NaN != Number.MAX_VALUE) === true'); +} + +//CHECK#7 +if ((Number.NaN != Number.MIN_VALUE) !== true) { + $ERROR('#7: (NaN != Number.MIN_VALUE) === true'); +} + +//CHECK#8 +if ((Number.NaN != "string") !== true) { + $ERROR('#8: (NaN != "string") === true'); +} + +//CHECK#9 +if ((Number.NaN != new Object()) !== true) { + $ERROR('#9: (NaN != new Object()) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.1_T2.js new file mode 100644 index 000000000..471bcb6f6 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.1_T2.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. + +/** + * If x or y is NaN, return true + * + * @path ch11/11.9/11.9.2/S11.9.2_A4.1_T2.js + * @description y is NaN + */ + +//CHECK#1 +if ((true != Number.NaN) !== true) { + $ERROR('#1: (true != NaN) === true'); +} + +//CHECK#2 +if ((-1 != Number.NaN) !== true) { + $ERROR('#2: (-1 != NaN) === true'); +} + +//CHECK#3 +if ((Number.NaN != Number.NaN) !== true) { + $ERROR('#3: (NaN != NaN) === true'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY != Number.NaN) !== true) { + $ERROR('#4: (+Infinity != NaN) === true'); +} + +//CHECK#5 +if ((Number.NEGATIVE_INFINITY != Number.NaN) !== true) { + $ERROR('#5: (-Infinity != NaN) === true'); +} + +//CHECK#6 +if ((Number.MAX_VALUE != Number.NaN) !== true) { + $ERROR('#6: (Number.MAX_VALUE != NaN) === true'); +} + +//CHECK#7 +if ((Number.MIN_VALUE != Number.NaN) !== true) { + $ERROR('#7: (Number.MIN_VALUE != NaN) === true'); +} + +//CHECK#8 +if (("string" != Number.NaN) !== true) { + $ERROR('#8: ("string" != NaN) === true'); +} + +//CHECK#9 +if ((new Object() != Number.NaN) !== true) { + $ERROR('#9: (new Object() != NaN) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.2.js new file mode 100644 index 000000000..b8045a6a0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.2.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +0(-0) and y is -0(+0), return false + * + * @path ch11/11.9/11.9.2/S11.9.2_A4.2.js + * @description Checking all combinations + */ + +//CHECK#1 +if ((+0 != -0) !== false) { + $ERROR('#1: (+0 != -0) === false'); +} + +//CHECK#2 +if ((-0 != +0) !== false) { + $ERROR('#2: (-0 != +0) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.3.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.3.js new file mode 100644 index 000000000..21cc16ee1 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A4.3.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are Number-s minus NaN, +0, -0. + * Return false, if x is the same number value as y; otherwise, return true + * + * @path ch11/11.9/11.9.2/S11.9.2_A4.3.js + * @description x and y are primitive numbers + */ + +//CHECK#1 +if ((Number.POSITIVE_INFINITY != Number.POSITIVE_INFINITY) !== false) { + $ERROR('#1: (+Infinity != +Infinity) === false'); +} + +//CHECK#2 +if ((Number.NEGATIVE_INFINITY != Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#2: (-Infinity != -Infinity) === false'); +} + +//CHECK#3 +if ((Number.POSITIVE_INFINITY != -Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#3: (+Infinity != -(-Infinity)) === false'); +} + +//CHECK#4 +if ((1 != 0.999999999999) !== true) { + $ERROR('#4: (1 != 0.999999999999) === true'); +} + +//CHECK#5 +if ((1.0 != 1) !== false) { + $ERROR('#5: (1.0 != 1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.1.js new file mode 100644 index 000000000..9476d907a --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.1.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. + +/** + * Type(x) and Type(y) are String-s. + * Return true, if x and y are exactly the same sequence of characters; otherwise, return false + * + * @path ch11/11.9/11.9.2/S11.9.2_A5.1.js + * @description x and y are primitive strings + */ + +//CHECK#1 +if (("" != "") !== false) { + $ERROR('#1: ("" != "") === false'); +} + +//CHECK#2 +if ((" " != " ") !== false) { + $ERROR('#2: " (" != " ") === false'); +} + +//CHECK#3 +if ((" " != "") !== true) { + $ERROR('#3: " (" != "") === true'); +} + +//CHECK#4 +if (("string" != "string") !== false) { + $ERROR('#4: ("string" != "string") === false'); +} + +//CHECK#5 +if ((" string" != "string ") !== true) { + $ERROR('#5: (" string" != "string ") === true'); +} + +//CHECK#6 +if (("1.0" != "1") !== true) { + $ERROR('#6: ("1.0" != "1") === true'); +} + +//CHECK#7 +if (("0xff" != "255") !== true) { + $ERROR('#7: ("0xff" != "255") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.2.js new file mode 100644 index 000000000..f63ffc17d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.2.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is Number and Type(y) is String, + * return the result of comparison x != ToNumber(y) + * + * @path ch11/11.9/11.9.2/S11.9.2_A5.2.js + * @description x is primitive number, y is primitive string + */ + +//CHECK#1 +if ((1 != "1") !== false) { + $ERROR('#1: (1 != "1") === false'); +} + +//CHECK#2 +if ((1.100 != "+1.10") !== false) { + $ERROR('#2: (1.100 != "+1.10") === false'); +} + +//CHECK#3 +if ((1 != "true") !== true) { + $ERROR('#3: (1 != "true") === true'); +} + +//CHECK#4 +if ((255 != "0xff") !== false) { + $ERROR('#4: (255 != "0xff") === false'); +} + +//CHECK#5 +if ((0 != "") !== false) { + $ERROR('#5: (0 != "") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.3.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.3.js new file mode 100644 index 000000000..dedd18ce0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A5.3.js @@ -0,0 +1,32 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is String and Type(y) is Number, + * return the result of comparison ToNumber(x) != y + * + * @path ch11/11.9/11.9.2/S11.9.2_A5.3.js + * @description x is primitive string, y is primitive number + */ + +//CHECK#1 +if (("-1" != -1) !== false) { + $ERROR('#1: ("-1" != -1) === false'); +} + +//CHECK#2 +if (("-1.100" != -1.10) !== false) { + $ERROR('#2: ("-1.100" != -1.10) === false'); +} + +//CHECK#3 +if (("false" != 0) !== true) { + $ERROR('#3: ("false" != 0) === true'); +} + +//CHECK#4 +if (("5e-324" != 5e-324) !== false) { + $ERROR('#4: ("5e-324" != 5e-324) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.1.js new file mode 100644 index 000000000..8d0cfcd35 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.1.js @@ -0,0 +1,40 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) as well as Type(y) is Undefined or Null, return true + * + * @path ch11/11.9/11.9.2/S11.9.2_A6.1.js + * @description Checking all combinations + */ + +//CHECK#1 +if ((undefined != undefined) !== false) { + $ERROR('#1: (undefined != undefined) === false'); +} + +//CHECK#2 +if ((void 0 != undefined) !== false) { + $ERROR('#2: (void 0 != undefined) === false'); +} + +//CHECK#3 +if ((undefined != eval("var x")) !== false) { + $ERROR('#3: (undefined != eval("var x")) === false'); +} + +//CHECK#4 +if ((undefined != null) !== false) { + $ERROR('#4: (undefined != null) === false'); +} + +//CHECK#5 +if ((null != void 0) !== false) { + $ERROR('#5: (null != void 0) === false'); +} + +//CHECK#6 +if ((null != null) !== false) { + $ERROR('#6: (null != null) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.2_T1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.2_T1.js new file mode 100644 index 000000000..e9a60e124 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.2_T1.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. + +/** + * If one expression is undefined or null and another is not, return false + * + * @path ch11/11.9/11.9.2/S11.9.2_A6.2_T1.js + * @description x is null or undefined, y is not + */ + +//CHECK#1 +if ((undefined != true) !== true) { + $ERROR('#1: (undefined != true) === true'); +} + +//CHECK#2 +if ((undefined != 0) !== true) { + $ERROR('#2: (undefined != 0) === true'); +} + +//CHECK#3 +if ((undefined != "undefined") !== true) { + $ERROR('#3: (undefined != "undefined") === true'); +} + +//CHECK#4 +if ((undefined != {}) !== true) { + $ERROR('#4: (undefined != {}) === true'); +} + +//CHECK#5 +if ((null != false) !== true) { + $ERROR('#5: (null != false) === true'); +} + +//CHECK#6 +if ((null != 0) !== true) { + $ERROR('#6: (null != 0) === true'); +} + +//CHECK#7 +if ((null != "null") !== true) { + $ERROR('#7: (null != "null") === true'); +} + +//CHECK#8 +if ((null != {}) !== true) { + $ERROR('#8: (null != {}) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.2_T2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.2_T2.js new file mode 100644 index 000000000..05b592b48 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A6.2_T2.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. + +/** + * If one expression is undefined or null and another is not, return false + * + * @path ch11/11.9/11.9.2/S11.9.2_A6.2_T2.js + * @description y is null or undefined, x is not + */ + +//CHECK#1 +if ((false != undefined) !== true) { + $ERROR('#1: (false != undefined) === true'); +} + +//CHECK#2 +if ((Number.NaN != undefined) !== true) { + $ERROR('#2: (Number.NaN != undefined) === true'); +} + +//CHECK#3 +if (("undefined" != undefined) !== true) { + $ERROR('#3: ("undefined" != undefined) === true'); +} + +//CHECK#4 +if (({} != undefined) !== true) { + $ERROR('#4: ({} != undefined) === true'); +} + +//CHECK#5 +if ((false != null) !== true) { + $ERROR('#5: (false != null) === true'); +} + +//CHECK#6 +if ((0 != null) !== true) { + $ERROR('#6: (0 != null) === true'); +} + +//CHECK#7 +if (("null" != null) !== true) { + $ERROR('#7: ("null" != null) === true'); +} + +//CHECK#8 +if (({} != null) !== true) { + $ERROR('#8: ({} != null) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.1.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.1.js new file mode 100644 index 000000000..66b468892 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.1.js @@ -0,0 +1,53 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are Object-s. + * Return true, if x and y are references to the same Object; otherwise, return false + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.1.js + * @description Checking Boolean object, Number object, String object, Object object + */ + +//CHECK#1 +if ((new Boolean(true) != new Boolean(true)) !== true) { + $ERROR('#1: (new Boolean(true) != new Boolean(true)) === true'); +} + +//CHECK#2 +if ((new Number(1) != new Number(1)) !== true) { + $ERROR('#2: (new Number(1) != new Number(1)) === true'); +} + +//CHECK#3 +if ((new String("x") != new String("x")) !== true) { + $ERROR('#3: (new String("x") != new String("x")) === true'); +} + +//CHECK#4 +if ((new Object() != new Object()) !== true) { + $ERROR('#4: (new Object() != new Object()) === true'); +} + +//CHECK#5 +x = {}; +y = x; +if ((x != y) !== false) { + $ERROR('#5: x = {}; y = x; (x != y) === false'); +} + +//CHECK#6 +if ((new Boolean(true) != new Number(1)) !== true) { + $ERROR('#6 (new Boolean(true) != new Number(1)) === true'); +} + +//CHECK#7 +if ((new Number(1) != new String("1")) !== true) { + $ERROR('#7: (new Number(1) != new String("1")) === true'); +} + +//CHECK#8 +if ((new String("1") != new Boolean(true)) !== true) { + $ERROR('#8: (new String("x") != new Boolean(true)) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.2.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.2.js new file mode 100644 index 000000000..44252a045 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.2.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. + +/** + * If Type(x) is Object and Type(y) is Boolean, + * return ToPrimitive(x) != y + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.2.js + * @description x is object, y is primitive boolean + */ + +//CHECK#1 +if ((new Boolean(true) != true) !== false) { + $ERROR('#1: (new Boolean(true) != true) === false'); +} + +//CHECK#2 +if ((new Number(1) != true) !== false) { + $ERROR('#2: (new Number(1) != true) === false'); +} + +//CHECK#3 +if ((new String("1") != true) !== false) { + $ERROR('#3: (new String("1") != true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.3.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.3.js new file mode 100644 index 000000000..7bd33386e --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.3.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. + +/** + * If Type(x) is Boolean and Type(y) is Object, + * return x != ToPrimitive(y) + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.3.js + * @description y is object, x is primitive boolean + */ + +//CHECK#1 +if ((true != new Boolean(true)) !== false) { + $ERROR('#1: (true != new Boolean(true)) === false'); +} + +//CHECK#2 +if ((true != new Number(1)) !== false) { + $ERROR('#2: (true != new Number(1)) === false'); +} + +//CHECK#3 +if ((true != new String("+1")) !== false) { + $ERROR('#3: (true != new String("+1")) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.4.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.4.js new file mode 100644 index 000000000..c13672d52 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.4.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. + +/** + * If Type(x) is Object and Type(y) is Number, + * return ToPrimitive(x) != y + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.4.js + * @description x is object, y is primitive number + */ + +//CHECK#1 +if ((new Boolean(true) != 1) !== false) { + $ERROR('#1: (new Boolean(true) != 1) === false'); +} + +//CHECK#2 +if ((new Number(-1) != -1) !== false) { + $ERROR('#2: (new Number(-1) != -1) === false'); +} + +//CHECK#3 +if ((new String("-1") != -1) !== false) { + $ERROR('#3: (new String("-1") != -1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.5.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.5.js new file mode 100644 index 000000000..c6cfc4976 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.5.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. + +/** + * If Type(x) is Number and Type(y) is Object, + * return x != ToPrimitive(y) + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.5.js + * @description y is object, x is primitive number + */ + +//CHECK#1 +if ((1 != new Boolean(true)) !== false) { + $ERROR('#1: (1 != new Boolean(true)) === false'); +} + +//CHECK#2 +if ((-1 != new Number(-1)) !== false) { + $ERROR('#2: (-1 != new Number(-1)) === false'); +} + +//CHECK#3 +if ((-1 != new String("-1")) !== false) { + $ERROR('#3: (-1 != new String("-1")) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.6.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.6.js new file mode 100644 index 000000000..286b9d4d0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.6.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. + +/** + * If Type(x) is Object and Type(y) is String, + * return ToPrimitive(x) != y + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.6.js + * @description x is object, y is primitive string + */ + +//CHECK#1 +if ((new Boolean(true) != "1") !== false) { + $ERROR('#1: (new Boolean(true) != "1") === false'); +} + +//CHECK#2 +if ((new Number(-1) != "-1") !== false) { + $ERROR('#2: (new Number(-1) != "-1") === false'); +} + +//CHECK#3 +if ((new String("x") != "x") !== false) { + $ERROR('#3: (new String("x") != "x") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.7.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.7.js new file mode 100644 index 000000000..cdc8161e0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.7.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. + +/** + * If Type(x) is String and Type(y) is Object, + * return x != ToPrimitive(y) + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.7.js + * @description y is object, x is primitive string + */ + +//CHECK#1 +if (("1" != new Boolean(true)) !== false) { + $ERROR('#1: ("1" != new Boolean(true)) === false'); +} + +//CHECK#2 +if (("-1" != new Number(-1)) !== false) { + $ERROR('#2: ("-1" != new Number(-1)) === false'); +} + +//CHECK#3 +if (("x" != new String("x")) !== false) { + $ERROR('#3: ("x" != new String("x")) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.8.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.8.js new file mode 100644 index 000000000..cf9766d79 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.8.js @@ -0,0 +1,76 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is Object and Type(y) is primitive type, + * return ToPrimitive(x) != y + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.8.js + * @description x is object, y is primtitive + */ + +//CHECK#1 +if ((true != {valueOf: function() {return 1}}) !== false) { + $ERROR('#1: (true != {valueOf: function() {return 1}}) === false'); +} + +//CHECK#2 +if ((1 != {valueOf: function() {return 1}, toString: function() {return 0}}) !== false) { + $ERROR('#2: (1 != {valueOf: function() {return 1}, toString: function() {return 0}}) === false'); +} + +//CHECK#3 +if (("+1" != {valueOf: function() {return 1}, toString: function() {return {}}}) !== false) { + $ERROR('#3: ("+1" != {valueOf: function() {return 1}, toString: function() {return {}}}) === false'); +} + +//CHECK#4 +try { + if ((true != {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) !== false) { + $ERROR('#4.1: (true != {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) === false'); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: (true != {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) not throw "error"'); + } else { + $ERROR('#4.3: (true != {valueOf: function() {return "+1"}, toString: function() {throw "error"}}) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if ((1 != {toString: function() {return "+1"}}) !== false) { + $ERROR('#5: (1 != {toString: function() {return "+1"}}) === false'); +} + +//CHECK#6 +if (("1" != {valueOf: function() {return {}}, toString: function() {return "+1"}}) !== true) { + $ERROR('#6.1: ("1" != {valueOf: function() {return {}}, toString: function() {return "+1"}}) === true'); +} else { + if (("+1" != {valueOf: function() {return {}}, toString: function() {return "+1"}}) !== false) { + $ERROR('#6.2: ("+1" != {valueOf: function() {return {}}, toString: function() {return "+1"}}) === false'); + } +} + +//CHECK#7 +try { + (1 != {valueOf: function() {throw "error"}, toString: function() {return 1}}); + $ERROR('#7: (1 != {valueOf: function() {throw "error"}, toString: function() {return 1}}) throw "error"'); +} +catch (e) { + if (e !== "error") { + $ERROR('#7: (1 != {valueOf: function() {throw "error"}, toString: function() {return 1}}) throw "error"'); + } +} + +//CHECK#8 +try { + (1 != {valueOf: function() {return {}}, toString: function() {return {}}}); + $ERROR('#8: (1 != {valueOf: function() {return {}}, toString: function() {return {}}}) throw TypeError'); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8: (1 != {valueOf: function() {return {}}, toString: function() {return {}}}) throw TypeError'); + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.9.js b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.9.js new file mode 100644 index 000000000..c1ccc5f32 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/S11.9.2_A7.9.js @@ -0,0 +1,76 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is primitive type and Type(y) is Object, + * return x != ToPrimitive(y) + * + * @path ch11/11.9/11.9.2/S11.9.2_A7.9.js + * @description y is object, x is primtitive + */ + +//CHECK#1 +if (({valueOf: function() {return 1}} != true) !== false) { + $ERROR('#1: ({valueOf: function() {return 1}} != true) === false'); +} + +//CHECK#2 +if (({valueOf: function() {return 1}, toString: function() {return 0}} != 1) !== false) { + $ERROR('#2: ({valueOf: function() {return 1}, toString: function() {return 0}} != 1) === false'); +} + +//CHECK#3 +if (({valueOf: function() {return 1}, toString: function() {return {}}} != "+1") !== false) { + $ERROR('#3: ({valueOf: function() {return 1}, toString: function() {return {}}} != "+1") === false'); +} + +//CHECK#4 +try { + if (({valueOf: function() {return "+1"}, toString: function() {throw "error"}} != true) !== false) { + $ERROR('#4.1: ({valueOf: function() {return "+1"}, toString: function() {throw "error"}} != true) === false'); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: ({valueOf: function() {return "+1"}, toString: function() {throw "error"}} != true) not throw "error"'); + } else { + $ERROR('#4.3: ({valueOf: function() {return "+1"}, toString: function() {throw "error"}} != true) not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if (({toString: function() {return "+1"}} != 1) !== false) { + $ERROR('#5: ({toString: function() {return "+1"}} != 1) === false'); +} + +//CHECK#6 +if (({valueOf: function() {return {}}, toString: function() {return "+1"}} != "1") !== true) { + $ERROR('#6.1: ({valueOf: function() {return {}}, toString: function() {return "+1"}} != "1") === true'); +} else { + if (({valueOf: function() {return {}}, toString: function() {return "+1"}} != "+1") !== false) { + $ERROR('#6.2: ({valueOf: function() {return {}}, toString: function() {return "+1"}} != "+1") === false'); + } +} + +//CHECK#7 +try { + ({valueOf: function() {throw "error"}, toString: function() {return 1}} != 1); + $ERROR('#7.1: ({valueOf: function() {throw "error"}, toString: function() {return 1}} != 1) throw "error". Actual: ' + (({valueOf: function() {throw "error"}, toString: function() {return 1}} != 1))); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: ({valueOf: function() {throw "error"}, toString: function() {return 1}} != 1) throw "error". Actual: ' + (e)); + } +} + +//CHECK#8 +try { + ({valueOf: function() {return {}}, toString: function() {return {}}} != 1); + $ERROR('#8.1: ({valueOf: function() {return {}}, toString: function() {return {}}} != 1) throw TypeError. Actual: ' + (({valueOf: function() {return {}}, toString: function() {return {}}} != 1))); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#8.2: ({valueOf: function() {return {}}, toString: function() {return {}}} != 1) throw TypeError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/browser.js b/js/src/tests/test262/ch11/11.9/11.9.2/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/browser.js diff --git a/js/src/tests/test262/ch11/11.9/11.9.2/shell.js b/js/src/tests/test262/ch11/11.9/11.9.2/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.2/shell.js diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A1.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A1.js new file mode 100644 index 000000000..410fe3962 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A1.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * White Space and Line Terminator between EqualityExpression and "===" or between "===" and RelationalExpression are allowed + * + * @path ch11/11.9/11.9.4/S11.9.4_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (!(eval("1\u0009===\u00091"))) { + $ERROR('#1: 1\\u0009===\\u00091'); +} + +//CHECK#2 +if (!(eval("1\u000B===\u000B1"))) { + $ERROR('#2: 1\\u000B===\\u000B1'); +} + +//CHECK#3 +if (!(eval("1\u000C===\u000C1"))) { + $ERROR('#3: 1\\u000C===\\u000C1'); +} + +//CHECK#4 +if (!(eval("1\u0020===\u00201"))) { + $ERROR('#4: 1\\u0020===\\u00201'); +} + +//CHECK#5 +if (!(eval("1\u00A0===\u00A01"))) { + $ERROR('#5: 1\\u00A0===\\u00A01'); +} + +//CHECK#6 +if (!(eval("1\u000A===\u000A1"))) { + $ERROR('#6: 1\\u000A===\\u000A1'); +} + +//CHECK#7 +if (!(eval("1\u000D===\u000D1"))) { + $ERROR('#7: 1\\u000D===\\u000D1'); +} + +//CHECK#8 +if (!(eval("1\u2028===\u20281"))) { + $ERROR('#8: 1\\u2028===\\u20281'); +} + +//CHECK#9 +if (!(eval("1\u2029===\u20291"))) { + $ERROR('#9: 1\\u2029===\\u20291'); +} + +//CHECK#10 +if (!(eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029===\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291"))) { + $ERROR('#10: 1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029===\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T1.js new file mode 100644 index 000000000..b9a1958cb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T1.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x === y uses GetValue + * + * @path ch11/11.9/11.9.4/S11.9.4_A2.1_T1.js + * @description Either Type is not Reference or GetBase is not null + */ + +//CHECK#1 +if (!(1 === 1)) { + $ERROR('#1: 1 === 1'); +} + +//CHECK#2 +var x = 1; +if (!(x === 1)) { + $ERROR('#2: var x = 1; x === 1'); +} + +//CHECK#3 +var y = 1; +if (!(1 === y)) { + $ERROR('#3: var y = 1; 1 === y'); +} + +//CHECK#4 +var x = 1; +var y = 1; +if (!(x === y)) { + $ERROR('#4: var x = 1; var y = 1; x === y'); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objectx.prop = 1; +objecty.prop = 1; +if (!(objectx.prop === objecty.prop)) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop === objecty.prop'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T2.js new file mode 100644 index 000000000..c0741ccd1 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_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. + +/** + * Operator x === y uses GetValue + * + * @path ch11/11.9/11.9.4/S11.9.4_A2.1_T2.js + * @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)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T3.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T3.js new file mode 100644 index 000000000..dc50a2505 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.1_T3.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. + +/** + * Operator x === y uses GetValue + * + * @path ch11/11.9/11.9.4/S11.9.4_A2.1_T3.js + * @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)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T1.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T1.js new file mode 100644 index 000000000..f24d933b0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.4/S11.9.4_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var x = 0; +if (!((x = 1) === x)) { + $ERROR('#1: var x = 0; (x = 1) === x'); +} + +//CHECK#2 +var x = 0; +if (x === (x = 1)) { + $ERROR('#2: var x = 0; x !== (x = 1)'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T2.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T2.js new file mode 100644 index 000000000..02fe1ba7c --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_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. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.4/S11.9.4_A2.4_T2.js + * @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)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T3.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T3.js new file mode 100644 index 000000000..5b9fa7a03 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A2.4_T3.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.4/S11.9.4_A2.4_T3.js + * @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)); + } +} + +//CHECK#2 +if (!((y = 1) === y)) { + $ERROR('#2: (y = 1) === y'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A3.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A3.js new file mode 100644 index 000000000..5fc2545d4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A3.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are Boolean-s. + * Return true, if x and y are both true and both false; otherwise, return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A3.js + * @description x and y are primitive booleans + */ + +//CHECK#1 +if (!(true === true)) { + $ERROR('#1: true === true'); +} + +//CHECK#2 +if (!(false === false)) { + $ERROR('#2: false === false'); +} + +//CHECK#3 +if (true === false) { + $ERROR('#3: true !== false'); +} + +//CHECK#4 +if (false === true) { + $ERROR('#4: false !== true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.1_T1.js new file mode 100644 index 000000000..b742929df --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.1_T1.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. + +/** + * If x or y is NaN, return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A4.1_T1.js + * @description x is NaN + */ + +//CHECK#1 +if (Number.NaN === true) { + $ERROR('#1: NaN !== true'); +} + +//CHECK#2 +if (Number.NaN === 1) { + $ERROR('#2: NaN !== 1'); +} + +//CHECK#3 +if (Number.NaN === Number.NaN) { + $ERROR('#3: NaN !== NaN'); +} + +//CHECK#4 +if (Number.NaN === Number.POSITIVE_INFINITY) { + $ERROR('#4: NaN !== +Infinity'); +} + +//CHECK#5 +if (Number.NaN === Number.NEGATIVE_INFINITY) { + $ERROR('#5: NaN !== -Infinity'); +} + +//CHECK#6 +if (Number.NaN === Number.MAX_VALUE) { + $ERROR('#6: NaN !== Number.MAX_VALUE'); +} + +//CHECK#7 +if (Number.NaN === Number.MIN_VALUE) { + $ERROR('#7: NaN !== Number.MIN_VALUE'); +} + +//CHECK#8 +if (Number.NaN === "string") { + $ERROR('#8: NaN !== "string"'); +} + +//CHECK#9 +if (Number.NaN === new Object()) { + $ERROR('#9: NaN !== new Object()'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.1_T2.js new file mode 100644 index 000000000..3cd02a9fd --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.1_T2.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. + +/** + * If x or y is NaN, return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A4.1_T2.js + * @description y is NaN + */ + +//CHECK#1 +if (true === Number.NaN) { + $ERROR('#1: true !== NaN'); +} + +//CHECK#2 +if (-1 === Number.NaN) { + $ERROR('#2: -1 !== NaN'); +} + +//CHECK#3 +if (Number.NaN === Number.NaN) { + $ERROR('#3: NaN !== NaN'); +} + +//CHECK#4 +if (Number.POSITIVE_INFINITY === Number.NaN) { + $ERROR('#4: +Infinity !== NaN'); +} + +//CHECK#5 +if (Number.NEGATIVE_INFINITY === Number.NaN) { + $ERROR('#5: -Infinity !== NaN'); +} + +//CHECK#6 +if (Number.MAX_VALUE === Number.NaN) { + $ERROR('#6: Number.MAX_VALUE !== NaN'); +} + +//CHECK#7 +if (Number.MIN_VALUE === Number.NaN) { + $ERROR('#7: Number.MIN_VALUE !== NaN'); +} + +//CHECK#8 +if ("string" === Number.NaN) { + $ERROR('#8: "string" !== NaN'); +} + +//CHECK#9 +if (new Object() === Number.NaN) { + $ERROR('#9: new Object() !== NaN'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.2.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.2.js new file mode 100644 index 000000000..7de56ed7d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.2.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +0(-0) and y is -0(+0), return true + * + * @path ch11/11.9/11.9.4/S11.9.4_A4.2.js + * @description Checking all combinations + */ + +//CHECK#1 +if (!(+0 === -0)) { + $ERROR('#1: +0 === -0'); +} + +//CHECK#2 +if (!(-0 === +0)) { + $ERROR('#2: -0 === +0'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.3.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.3.js new file mode 100644 index 000000000..e13bea441 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A4.3.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. + +/** + * Type(x) and Type(y) are Number-s minus NaN, +0, -0. + * Return true, if x is the same number value as y; otherwise, return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A4.3.js + * @description x and y are primitive numbers + */ + +//CHECK#1 +if (!(Number.POSITIVE_INFINITY === Number.POSITIVE_INFINITY)) { + $ERROR('#1: +Infinity === +Infinity'); +} + +//CHECK#2 +if (!(Number.NEGATIVE_INFINITY === Number.NEGATIVE_INFINITY)) { + $ERROR('#2: -Infinity === -Infinity'); +} + +//CHECK#3 +if (!(13 === 13)) { + $ERROR('#3: 13 === 13'); +} + +//CHECK#4 +if (!(-13 === -13)) { + $ERROR('#4: -13 === -13'); +} + +//CHECK#5 +if (!(1.3 === 1.3)) { + $ERROR('#5: 1.3 === 1.3'); +} + +//CHECK#6 +if (!(-1.3 === -1.3)) { + $ERROR('#6: -1.3 === -1.3'); +} + +//CHECK#7 +if (!(Number.POSITIVE_INFINITY === -Number.NEGATIVE_INFINITY)) { + $ERROR('#7: +Infinity === -(-Infinity)'); +} + +//CHECK#8 +if (1 === 0.999999999999) { + $ERROR('#8: 1 !== 0.999999999999'); +} + +//CHECK#9 +if (!(1.0 === 1)) { + $ERROR('#9: 1.0 === 1'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A5.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A5.js new file mode 100644 index 000000000..f32d7c5ae --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A5.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are String-s. + * Return true, if x and y are exactly the same sequence of characters; otherwise, return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A5.js + * @description x and y are primitive strings + */ + +//CHECK#1 +if (!("" === "")) { + $ERROR('#1: "" === ""'); +} + +//CHECK#2 +if (!(" " === " ")) { + $ERROR('#2: " " === " "'); +} + +//CHECK#3 +if (!("string" === "string")) { + $ERROR('#3: "string" === "string"'); +} + +//CHECK#4 +if (" string" === "string ") { + $ERROR('#4: " string" !== "string "'); +} + +//CHECK#5 +if ("1.0" === "1") { + $ERROR('#5: "1.0" !== "1"'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A6.1.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A6.1.js new file mode 100644 index 000000000..b392d432a --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A6.1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) and Type(y) are Undefined-s, return true + * + * @path ch11/11.9/11.9.4/S11.9.4_A6.1.js + * @description void 0, eval("var x") is undefined + */ + +//CHECK#1 +if (!(undefined === undefined)) { + $ERROR('#1: undefined === undefined'); +} + +//CHECK#2 +if (!(void 0 === undefined)) { + $ERROR('#2: void 0 === undefined'); +} + +//CHECK#3 +if (!(undefined === eval("var x"))) { + $ERROR('#3: undefined === eval("var x")'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A6.2.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A6.2.js new file mode 100644 index 000000000..82bdbea6f --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A6.2.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) and Type(y) are Null-s, return true + * + * @path ch11/11.9/11.9.4/S11.9.4_A6.2.js + * @description null === null + */ + +//CHECK#1 +if (!(null === null)) { + $ERROR('#1: null === null'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A7.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A7.js new file mode 100644 index 000000000..0c27f3df5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A7.js @@ -0,0 +1,53 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are Object-s. + * Return true, if x and y are references to the same Object; otherwise, return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A7.js + * @description Checking Boolean object, Number object, String object, Object object + */ + +//CHECK#1 +if (new Object() === new Object()) { + $ERROR('#1: new Object() !== new Object()'); +} + +//CHECK#2 +if (new Object(true) === new Object(true)) { + $ERROR('#2: new Object() !== new Object()'); +} + +//CHECK#3 +if (new Object(false) === new Object(false)) { + $ERROR('#3: new Object() !== new Object()'); +} + +//CHECK#4 +if (new Object(+0) === new Object(-0)) { + $ERROR('#4: new Object(+0) !== new Object(-0)'); +} + +//CHECK#5 +x = {}; +y = x; +if (!(x === y)) { + $ERROR('#5: x = {}; y = x; x === y'); +} + +//CHECK#6 +if (new Boolean(true) === new Number(1)) { + $ERROR('#6 new Boolean(true) === new Number(1)'); +} + +//CHECK#7 +if (new Number(1) === new String("1")) { + $ERROR('#7: new Number(1) === new String("1")'); +} + +//CHECK#8 +if (new String("1") === new Boolean(true)) { + $ERROR('#8: new String("x") === new Boolean(true)'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T1.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T1.js new file mode 100644 index 000000000..ce51dddef --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T1.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is different from Type(y), return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A8_T1.js + * @description x or y is primitive boolean + */ + +//CHECK#1 +if (true === new Boolean(true)) { + $ERROR('#1: true !== new Number(true)'); +} + +//CHECK#2 +if (true === 1) { + $ERROR('#2: true !== 1'); +} + +//CHECK#3 +if (true === new Number(true)) { + $ERROR('#3: true !== new Number(true)'); +} + +//CHECK#4 +if (true === "1") { + $ERROR('#4: true !== "1"'); +} + +//CHECK#5 +if (true === new String(true)) { + $ERROR('#5: true !== new String(true)'); +} + +//CHECK#6 +if (new Boolean(false) === false) { + $ERROR('#6: new Number(false) !== false'); +} + +//CHECK#7 +if (0 === false) { + $ERROR('#7: 0 !== false'); +} + +//CHECK#8 +if (new Number(false) === false) { + $ERROR('#8: new Number(false) !== false'); +} + +//CHECK#9 +if ("0" === false) { + $ERROR('#9: "0" !== false'); +} + +//CHECK#10 +if (false === new String(false)) { + $ERROR('#10: false !== new String(false)'); +} + +//CHECK#11 +if (true === {valueOf: function () {return true}}) { + $ERROR('#11: true === {valueOf: function () {return true}}'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T2.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T2.js new file mode 100644 index 000000000..c7bfa4d5b --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T2.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is different from Type(y), return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A8_T2.js + * @description x or y is primitive number + */ + +//CHECK#1 +if (1 === new Number(1)) { + $ERROR('#1: 1 !== new Number(1)'); +} + +//CHECK#2 +if (1 === true) { + $ERROR('#2: 1 !== true'); +} + +//CHECK#3 +if (1 === new Boolean(1)) { + $ERROR('#3: 1 !== new Boolean(1)'); +} + +//CHECK#4 +if (1 === "1") { + $ERROR('#4: 1 !== "1"'); +} + +//CHECK#5 +if (1 === new String(1)) { + $ERROR('#5: 1 !== new String(1)'); +} + +//CHECK#6 +if (new Number(0) === 0) { + $ERROR('#6: new Number(0) !== 0'); +} + +//CHECK#7 +if (false === 0) { + $ERROR('#7: false !== 0'); +} + +//CHECK#8 +if (new Boolean(0) === 0) { + $ERROR('#8: new Boolean(0) !== 0'); +} + +//CHECK#9 +if ("0" === 0) { + $ERROR('#9: "0" !== 0'); +} + +//CHECK#10 +if (new String(0) === 0) { + $ERROR('#10: new String(0) !== 0'); +} + +//CHECK#11 +if (1 === {valueOf: function () {return 1}}) { + $ERROR('#11: 1 === {valueOf: function () {return 1}}'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T3.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T3.js new file mode 100644 index 000000000..a448bbd70 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T3.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is different from Type(y), return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A8_T3.js + * @description x or y is primitive string + */ + +//CHECK#1 +if ("1" === new String("1")) { + $ERROR('#1: "1" !== new String("1")'); +} + +//CHECK#2 +if ("1" === true) { + $ERROR('#2: "1" !== true'); +} + +//CHECK#3 +if ("1" === new Boolean("1")) { + $ERROR('#3: "1" !== new Boolean("1")'); +} + +//CHECK#4 +if ("1" === 1) { + $ERROR('#4: "1" === 1'); +} + +//CHECK#5 +if ("1" === new Number("1")) { + $ERROR('#5: "1" === new Number("1")'); +} + +//CHECK#6 +if (new String(false) === false) { + $ERROR('#6: new Number(false) !== false'); +} + +//CHECK#7 +if (false === "0") { + $ERROR('#7: false !== "0"'); +} + +//CHECK#8 +if ("0" === new Boolean("0")) { + $ERROR('#8: "0" !== new Boolean("0")'); +} + +//CHECK#9 +if (false === 0) { + $ERROR('#9: false !== 0'); +} + +//CHECK#10 +if (false === new Number(false)) { + $ERROR('#10: false !== new Number(false)'); +} + +//CHECK#11 +if ("1" === {valueOf: function () {return "1"}}) { + $ERROR('#11: "1" === {valueOf: function () {return "1"}}'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T4.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T4.js new file mode 100644 index 000000000..92aa846ca --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T4.js @@ -0,0 +1,80 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is different from Type(y), return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A8_T4.js + * @description x or y is null or undefined + */ + +//CHECK#1 +if (undefined === null) { + $ERROR('#1: undefined !== null'); +} + +//CHECK#2 +if (null === undefined) { + $ERROR('#2: null !== undefined'); +} + +//CHECK#3 +if (null === 0) { + $ERROR('#3: null !== 0'); +} + +//CHECK#4 +if (0 === null) { + $ERROR('#4: 0 !== null'); +} + +//CHECK#5 +if (null === false) { + $ERROR('#5: null !== false'); +} + +//CHECK#6 +if (false === null) { + $ERROR('#6: false !== null'); +} + +//CHECK#7 +if (undefined === false) { + $ERROR('#7: undefined !== false'); +} + +//CHECK#8 +if (false === undefined) { + $ERROR('#8: false !== undefined'); +} + +//CHECK#9 +if (null === new Object()) { + $ERROR('#9: null !== new Object()'); +} + +//CHECK#10 +if (new Object() === null) { + $ERROR('#10: new Object() !== null'); +} + +//CHECK#11 +if (null === "null") { + $ERROR('#11: null !== "null"'); +} + +//CHECK#12 +if ("null" === null) { + $ERROR('#12: "null" !== null'); +} + +//CHECK#13 +if (undefined === "undefined") { + $ERROR('#13: undefined !== "undefined"'); +} + +//CHECK#14 +if ("undefined" === undefined) { + $ERROR('#14: "undefined" !== undefined'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T5.js b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T5.js new file mode 100644 index 000000000..5e6bdb2fd --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/S11.9.4_A8_T5.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. + +/** + * If Type(x) is different from Type(y), return false + * + * @path ch11/11.9/11.9.4/S11.9.4_A8_T5.js + * @description Checking with such x and y that either x or y is primitive string and the other is primitive number + */ + +//CHECK#1 +try { + throw 1; +} catch(e) { + if (e === "1") { + $ERROR('#1: throw 1 !== "1"'); + } +} + +//CHECK#2 +try { + throw "1"; +} catch(e) { + if (1 === e) { + $ERROR('#2: 1 !== throw "1"'); + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/browser.js b/js/src/tests/test262/ch11/11.9/11.9.4/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/browser.js diff --git a/js/src/tests/test262/ch11/11.9/11.9.4/shell.js b/js/src/tests/test262/ch11/11.9/11.9.4/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.4/shell.js diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A1.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A1.js new file mode 100644 index 000000000..c9e88dc0c --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A1.js @@ -0,0 +1,60 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * White Space and Line Terminator between EqualityExpression and "!==" or between "!==" and RelationalExpression are allowed + * + * @path ch11/11.9/11.9.5/S11.9.5_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("1\u0009!==\u00091")) { + $ERROR('#1: 1\\u0009!==\\u00091'); +} + +//CHECK#2 +if (eval("1\u000B!==\u000B1")) { + $ERROR('#2: 1\\u000B!==\\u000B1'); +} + +//CHECK#3 +if (eval("1\u000C!==\u000C1")) { + $ERROR('#3: 1\\u000C!==\\u000C1'); +} + +//CHECK#4 +if (eval("1\u0020!==\u00201")) { + $ERROR('#4: 1\\u0020!==\\u00201'); +} + +//CHECK#5 +if (eval("1\u00A0!==\u00A01")) { + $ERROR('#5: 1\\u00A0!==\\u00A01'); +} + +//CHECK#6 +if (eval("1\u000A!==\u000A1")) { + $ERROR('#6: 1\\u000A!==\\u000A1'); +} + +//CHECK#7 +if (eval("1\u000D!==\u000D1")) { + $ERROR('#7: 1\\u000D!==\\u000D1'); +} + +//CHECK#8 +if (eval("1\u2028!==\u20281")) { + $ERROR('#8: 1\\u2028!==\\u20281'); +} + +//CHECK#9 +if (eval("1\u2029!==\u20291")) { + $ERROR('#9: 1\\u2029!==\\u20291'); +} + +//CHECK#10 +if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029!==\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291")) { + $ERROR('#10: 1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029!==\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T1.js new file mode 100644 index 000000000..4e9c43c3b --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T1.js @@ -0,0 +1,44 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x !== y uses GetValue + * + * @path ch11/11.9/11.9.5/S11.9.5_A2.1_T1.js + * @description Either Type is not Reference or GetBase is not null + */ + +//CHECK#1 +if (1 !== 1) { + $ERROR('#1: 1 === 1'); +} + +//CHECK#2 +var x = 1; +if (x !== 1) { + $ERROR('#2: var x = 1; x === 1'); +} + +//CHECK#3 +var y = 1; +if (1 !== y) { + $ERROR('#3: var y = 1; 1 === y'); +} + +//CHECK#4 +var x = 1; +var y = 1; +if (x !== y) { + $ERROR('#4: var x = 1; var y = 1; x === y'); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objectx.prop = 1; +objecty.prop = 1; +if (objectx.prop !== objecty.prop) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 1; objectx.prop === objecty.prop'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T2.js new file mode 100644 index 000000000..52637ce50 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_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. + +/** + * Operator x !== y uses GetValue + * + * @path ch11/11.9/11.9.5/S11.9.5_A2.1_T2.js + * @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)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T3.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T3.js new file mode 100644 index 000000000..e568cbe31 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.1_T3.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. + +/** + * Operator x !== y uses GetValue + * + * @path ch11/11.9/11.9.5/S11.9.5_A2.1_T3.js + * @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)); + } +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T1.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T1.js new file mode 100644 index 000000000..7ed77b440 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T1.js @@ -0,0 +1,23 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.5/S11.9.5_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var x = 0; +if ((x = 1) !== x) { + $ERROR('#1: var x = 0; (x = 1) === x'); +} + +//CHECK#2 +var x = 0; +if (!(x !== (x = 1))) { + $ERROR('#2: var x = 0; x !== (x = 1)'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T2.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T2.js new file mode 100644 index 000000000..b2872fcde --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_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. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.5/S11.9.5_A2.4_T2.js + * @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)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T3.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T3.js new file mode 100644 index 000000000..d25f15e4d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A2.4_T3.js @@ -0,0 +1,27 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * First expression is evaluated first, and then second expression + * + * @path ch11/11.9/11.9.5/S11.9.5_A2.4_T3.js + * @description Checking 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)); + } +} + +//CHECK#2 +if ((y = 1) !== y) { + $ERROR('#2: (y = 1) === y'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A3.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A3.js new file mode 100644 index 000000000..f13b4574d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A3.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are Boolean-s. + * Return false, if x and y are both true or both false; otherwise, return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A3.js + * @description x and y are primitive booleans + */ + +//CHECK#1 +if (true !== true) { + $ERROR('#1: true === true'); +} + +//CHECK#2 +if (false !== false) { + $ERROR('#2: false === false'); +} + +//CHECK#3 +if (!(true !== false)) { + $ERROR('#3: true !== false'); +} + +//CHECK#4 +if (!(false !== true)) { + $ERROR('#4: false !== true'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.1_T1.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.1_T1.js new file mode 100644 index 000000000..44548006b --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.1_T1.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. + +/** + * If x or y is NaN, return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A4.1_T1.js + * @description x is NaN + */ + +//CHECK#1 +if (!(Number.NaN !== true)) { + $ERROR('#1: NaN !== true'); +} + +//CHECK#2 +if (!(Number.NaN !== 1)) { + $ERROR('#2: NaN !== 1'); +} + +//CHECK#3 +if (!(Number.NaN !== Number.NaN)) { + $ERROR('#3: NaN !== NaN'); +} + +//CHECK#4 +if (!(Number.NaN !== Number.POSITIVE_INFINITY)) { + $ERROR('#4: NaN !== +Infinity'); +} + +//CHECK#5 +if (!(Number.NaN !== Number.NEGATIVE_INFINITY)) { + $ERROR('#5: NaN !== -Infinity'); +} + +//CHECK#6 +if (!(Number.NaN !== Number.MAX_VALUE)) { + $ERROR('#6: NaN !== Number.MAX_VALUE'); +} + +//CHECK#7 +if (!(Number.NaN !== Number.MIN_VALUE)) { + $ERROR('#7: NaN !== Number.MIN_VALUE'); +} + +//CHECK#8 +if (!(Number.NaN !== "string")) { + $ERROR('#8: NaN !== "string"'); +} + +//CHECK#9 +if (!(Number.NaN !== new Object())) { + $ERROR('#9: NaN !== new Object()'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.1_T2.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.1_T2.js new file mode 100644 index 000000000..8503f0a41 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.1_T2.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. + +/** + * If x or y is NaN, return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A4.1_T2.js + * @description y is NaN + */ + +//CHECK#1 +if (!(true !== Number.NaN)) { + $ERROR('#1: true !== NaN'); +} + +//CHECK#2 +if (!(-1 !== Number.NaN)) { + $ERROR('#2: -1 !== NaN'); +} + +//CHECK#3 +if (!(Number.NaN !== Number.NaN)) { + $ERROR('#3: NaN !== NaN'); +} + +//CHECK#4 +if (!(Number.POSITIVE_INFINITY !== Number.NaN)) { + $ERROR('#4: +Infinity !== NaN'); +} + +//CHECK#5 +if (!(Number.NEGATIVE_INFINITY !== Number.NaN)) { + $ERROR('#5: -Infinity !== NaN'); +} + +//CHECK#6 +if (!(Number.MAX_VALUE !== Number.NaN)) { + $ERROR('#6: Number.MAX_VALUE !== NaN'); +} + +//CHECK#7 +if (!(Number.MIN_VALUE !== Number.NaN)) { + $ERROR('#7: Number.MIN_VALUE !== NaN'); +} + +//CHECK#8 +if (!("string" !== Number.NaN)) { + $ERROR('#8: "string" !== NaN'); +} + +//CHECK#9 +if (!(new Object() !== Number.NaN)) { + $ERROR('#9: new Object() !== NaN'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.2.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.2.js new file mode 100644 index 000000000..1844bb10f --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.2.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +0(-0) and y is -0(+0), return false + * + * @path ch11/11.9/11.9.5/S11.9.5_A4.2.js + * @description Checking all combinations + */ + +//CHECK#1 +if (+0 !== -0) { + $ERROR('#1: +0 === -0'); +} + +//CHECK#2 +if (-0 !== +0) { + $ERROR('#2: -0 === +0'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.3.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.3.js new file mode 100644 index 000000000..b5469c3b3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A4.3.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. + +/** + * Type(x) and Type(y) are Number-s minus NaN, +0, -0. + * Return false, if x is the same number value as y; otherwise, return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A4.3.js + * @description x and y are primitive numbers + */ + +//CHECK#1 +if (Number.POSITIVE_INFINITY !== Number.POSITIVE_INFINITY) { + $ERROR('#1: +Infinity === +Infinity'); +} + +//CHECK#2 +if (Number.NEGATIVE_INFINITY !== Number.NEGATIVE_INFINITY) { + $ERROR('#2: -Infinity === -Infinity'); +} + +//CHECK#3 +if (13 !== 13) { + $ERROR('#3: 13 === 13'); +} + +//CHECK#4 +if (-13 !== -13) { + $ERROR('#4: -13 === -13'); +} + +//CHECK#5 +if (1.3 !== 1.3) { + $ERROR('#5: 1.3 === 1.3'); +} + +//CHECK#6 +if (-1.3 !== -1.3) { + $ERROR('#6: -1.3 === -1.3'); +} + +//CHECK#7 +if (Number.POSITIVE_INFINITY !== -Number.NEGATIVE_INFINITY) { + $ERROR('#7: +Infinity === -(-Infinity)'); +} + +//CHECK#8 +if (!(1 !== 0.999999999999)) { + $ERROR('#8: 1 !== 0.999999999999'); +} + +//CHECK#9 +if (1.0 !== 1) { + $ERROR('#9: 1.0 === 1'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A5.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A5.js new file mode 100644 index 000000000..dabb86dbc --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A5.js @@ -0,0 +1,36 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Type(x) and Type(y) are String-s. + * Return false, if x and y are exactly the same sequence of characters; otherwise, return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A5.js + * @description x and y are primitive strings + */ + +//CHECK#1 +if ("" !== "") { + $ERROR('#1: "" === ""'); +} + +//CHECK#2 +if (" " !== " ") { + $ERROR('#2: " " === " "'); +} + +//CHECK#3 +if ("string" !== "string") { + $ERROR('#3: "string" === "string"'); +} + +//CHECK#4 +if (!(" string" !== "string ")) { + $ERROR('#4: " string" !== "string "'); +} + +//CHECK#5 +if (!("1.0" !== "1")) { + $ERROR('#5: "1.0" !== "1"'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A6.1.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A6.1.js new file mode 100644 index 000000000..7e89a7b6d --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A6.1.js @@ -0,0 +1,25 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) and Type(y) are Undefined-s, return false + * + * @path ch11/11.9/11.9.5/S11.9.5_A6.1.js + * @description void 0, eval("var x") is undefined + */ + +//CHECK#1 +if (undefined !== undefined) { + $ERROR('#1: undefined === undefined'); +} + +//CHECK#2 +if (void 0 !== undefined) { + $ERROR('#2: void 0 === undefined'); +} + +//CHECK#3 +if (undefined !== eval("var x")) { + $ERROR('#3: undefined === eval("var x")'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A6.2.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A6.2.js new file mode 100644 index 000000000..9657e153f --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A6.2.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) and Type(y) are Null-s, return false + * + * @path ch11/11.9/11.9.5/S11.9.5_A6.2.js + * @description null === null + */ + +//CHECK#1 +if (null !== null) { + $ERROR('#1: null === null'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A7.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A7.js new file mode 100644 index 000000000..1102b7a12 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A7.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. + +/** + * Type(x) and Type(y) are Object-s. + * Return false, if x and y are references to the same Object; otherwise, return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A7.js + * @description Checking Boolean object, Number object, String object, Object object + */ + +//CHECK#1 +if (!(new Object() !== new Object())) { + $ERROR('#1: new Object() !== new Object()'); +} + +//CHECK#2 +if (!(new Object(true) !== new Object(true))) { + $ERROR('#2: new Object() !== new Object()'); +} + +//CHECK#3 +if (!(new Object(false) !== new Object(false))) { + $ERROR('#3: new Object() !== new Object()'); +} + +//CHECK#4 +if (!(new Object(+0) !== new Object(-0))) { + $ERROR('#4: new Object(+0) !== new Object(-0)'); +} + +//CHECK#5 +x = {}; +y = x; +if (x !== y) { + $ERROR('#5: x = {}; y = x; x === y'); +} + +//CHECK#6 +if (!(new Boolean(true) !== new Number(1))) { + $ERROR('#6 new Boolean(true) !== new Number(1)'); +} + +//CHECK#7 +if (!(new Number(1) !== new String("1"))) { + $ERROR('#7: new Number(1) !== new String("1")'); +} + +//CHECK#8 +if (!(new String("1") !== new Boolean(true))) { + $ERROR('#8: new String("x") !== new Boolean(true)'); +} + + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T1.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T1.js new file mode 100644 index 000000000..8e342212e --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T1.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is different from Type(y), return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A8_T1.js + * @description x or y is primitive boolean + */ + +//CHECK#1 +if (!(true !== new Boolean(true))) { + $ERROR('#1: true !== new Number(true)'); +} + +//CHECK#2 +if (!(true !== 1)) { + $ERROR('#2: true !== 1'); +} + +//CHECK#3 +if (!(true !== new Number(true))) { + $ERROR('#3: true !== new Number(true)'); +} + +//CHECK#4 +if (!(true !== "1")) { + $ERROR('#4: true !== "1"'); +} + +//CHECK#5 +if (!(true !== new String(true))) { + $ERROR('#5: true !== new String(true)'); +} + +//CHECK#6 +if (!(new Boolean(false) !== false)) { + $ERROR('#6: new Number(false) !== false'); +} + +//CHECK#7 +if (!(0 !== false)) { + $ERROR('#7: 0 !== false'); +} + +//CHECK#8 +if (!(new Number(false) !== false)) { + $ERROR('#8: new Number(false) !== false'); +} + +//CHECK#9 +if (!("0" !== false)) { + $ERROR('#9: "0" !== false'); +} + +//CHECK#10 +if (!(false !== new String(false))) { + $ERROR('#10: false !== new String(false)'); +} + +//CHECK#11 +if (!(true !== {valueOf: function () {return true}})) { + $ERROR('#11: true !== {valueOf: function () {return true}}'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T2.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T2.js new file mode 100644 index 000000000..780807c97 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T2.js @@ -0,0 +1,65 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is different from Type(y), return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A8_T2.js + * @description x or y is primitive number + */ + +//CHECK#1 +if (!(1 !== new Number(1))) { + $ERROR('#1: 1 !== new Number(1)'); +} + +//CHECK#2 +if (!(1 !== true)) { + $ERROR('#2: 1 !== true'); +} + +//CHECK#3 +if (!(1 !== new Boolean(1))) { + $ERROR('#3: 1 !== new Boolean(1)'); +} + +//CHECK#4 +if (!(1 !== "1")) { + $ERROR('#4: 1 !== "1"'); +} + +//CHECK#5 +if (!(1 !== new String(1))) { + $ERROR('#5: 1 !== new String(1)'); +} + +//CHECK#6 +if (!(new Number(0) !== 0)) { + $ERROR('#6: new Number(0) !== 0'); +} + +//CHECK#7 +if (!(false !== 0)) { + $ERROR('#7: false !== 0'); +} + +//CHECK#8 +if (!(new Boolean(0) !== 0)) { + $ERROR('#8: new Boolean(0) !== 0'); +} + +//CHECK#9 +if (!("0" !== 0)) { + $ERROR('#9: "0" !== 0'); +} + +//CHECK#10 +if (!(new String(0) !== 0)) { + $ERROR('#10: new String(0) !== 0'); +} + +//CHECK#11 +if (!(1 !== {valueOf: function () {return 1}})) { + $ERROR('#11: 1 !== {valueOf: function () {return 1}}'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T3.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T3.js new file mode 100644 index 000000000..3206868db --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T3.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. + +/** + * If Type(x) is different from Type(y), return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A8_T3.js + * @description x or y is primitive string + */ + +//CHECK#1 +if (!("1" !== new String("1"))) { + $ERROR('#1: "1" !== new String("1")'); +} + +//CHECK#2 +if (!("1" !== true)) { + $ERROR('#2: "1" !== true'); +} + +//CHECK#3 +if (!("1" !== new Boolean("1"))) { + $ERROR('#3: "1" !== new Boolean("1")'); +} + +//CHECK#4 +if (!("1" !== 1)) { + $ERROR('#4: "1" === 1'); +} + +//CHECK#5 +if (!("1" !== new Number("1"))) { + $ERROR('#5: "1" === new Number("1")'); +} + +//CHECK#6 +if (!(new String(false) !== false)) { + $ERROR('#6: new Number(false) !== false'); +} + +//CHECK#7 +if (!(false !== "0")) { + $ERROR('#7: false !== "0"'); +} + +//CHECK#8 +if (!("0" !== new Boolean("0"))) { + $ERROR('#8: "0" !== new Boolean("0")'); +} + +//CHECK#9 +if (!(false !== 0)) { + $ERROR('#9: false !== 0'); +} + +//CHECK#10 +if (!(false !== new Number(false))) { + $ERROR('#10: false !== new Number(false)'); +} + +//CHECK#11 +if (!("1" !== {valueOf: function () {return "1"}})) { + $ERROR('#11: "1" !== {valueOf: function () {return "1"}}'); +} + + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T4.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T4.js new file mode 100644 index 000000000..004549142 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T4.js @@ -0,0 +1,80 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If Type(x) is different from Type(y), return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A8_T4.js + * @description x or y is null or undefined + */ + +//CHECK#1 +if (!(undefined !== null)) { + $ERROR('#1: undefined !== null'); +} + +//CHECK#2 +if (!(null !== undefined)) { + $ERROR('#2: null !== undefined'); +} + +//CHECK#3 +if (!(null !== 0)) { + $ERROR('#3: null !== 0'); +} + +//CHECK#4 +if (!(0 !== null)) { + $ERROR('#4: 0 !== null'); +} + +//CHECK#5 +if (!(null !== false)) { + $ERROR('#5: null !== false'); +} + +//CHECK#6 +if (!(false !== null)) { + $ERROR('#6: false !== null'); +} + +//CHECK#7 +if (!(undefined !== false)) { + $ERROR('#7: undefined !== false'); +} + +//CHECK#8 +if (!(false !== undefined)) { + $ERROR('#8: false !== undefined'); +} + +//CHECK#9 +if (!(null !== new Object())) { + $ERROR('#9: null !== new Object()'); +} + +//CHECK#10 +if (!(new Object() !== null)) { + $ERROR('#10: new Object() !== null'); +} + +//CHECK#11 +if (!(null !== "null")) { + $ERROR('#11: null !== "null"'); +} + +//CHECK#12 +if (!("null" !== null)) { + $ERROR('#12: "null" !== null'); +} + +//CHECK#13 +if (!(undefined !== "undefined")) { + $ERROR('#13: undefined !== "undefined"'); +} + +//CHECK#14 +if (!("undefined" !== undefined)) { + $ERROR('#14: "undefined" !== undefined'); +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T5.js b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T5.js new file mode 100644 index 000000000..3f2c4a627 --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/S11.9.5_A8_T5.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. + +/** + * If Type(x) is different from Type(y), return true + * + * @path ch11/11.9/11.9.5/S11.9.5_A8_T5.js + * @description Checking such x and y that either x or y is primitive string and the other is primitive number + */ + +//CHECK#1 +try { + throw 1; +} catch(e) { + if (!(e !== "1")) { + $ERROR('#1: throw 1 !== "1"'); + } +} + +//CHECK#2 +try { + throw "1"; +} catch(e) { + if (!(1 !== e)) { + $ERROR('#2: 1 !== throw "1"'); + } +} + diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/browser.js b/js/src/tests/test262/ch11/11.9/11.9.5/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/browser.js diff --git a/js/src/tests/test262/ch11/11.9/11.9.5/shell.js b/js/src/tests/test262/ch11/11.9/11.9.5/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/11.9.5/shell.js diff --git a/js/src/tests/test262/ch11/11.9/browser.js b/js/src/tests/test262/ch11/11.9/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/browser.js diff --git a/js/src/tests/test262/ch11/11.9/shell.js b/js/src/tests/test262/ch11/11.9/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.9/shell.js |