diff options
Diffstat (limited to 'js/src/tests/test262/ch11/11.8')
196 files changed, 6811 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A1.js new file mode 100644 index 000000000..5203b7341 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.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 RelationalExpression and "<" or between "<" and ShiftExpression are allowed + * + * @path ch11/11.8/11.8.1/S11.8.1_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("0\u0009<\u00091") !== true) { + $ERROR('#1: (0\\u0009<\\u00091) === true'); +} + +//CHECK#2 +if (eval("0\u000B<\u000B1") !== true) { + $ERROR('#2: (0\\u000B<\\u000B1) === true'); +} + +//CHECK#3 +if (eval("0\u000C<\u000C1") !== true) { + $ERROR('#3: (0\\u000C<\\u000C1) === true'); +} + +//CHECK#4 +if (eval("0\u0020<\u00201") !== true) { + $ERROR('#4: (0\\u0020<\\u00201) === true'); +} + +//CHECK#5 +if (eval("0\u00A0<\u00A01") !== true) { + $ERROR('#5: (0\\u00A0<\\u00A01) === true'); +} + +//CHECK#6 +if (eval("0\u000A<\u000A1") !== true) { + $ERROR('#6: (0\\u000A<\\u000A1) === true'); +} + +//CHECK#7 +if (eval("0\u000D<\u000D1") !== true) { + $ERROR('#7: (0\\u000D<\\u000D1) === true'); +} + +//CHECK#8 +if (eval("0\u2028<\u20281") !== true) { + $ERROR('#8: (0\\u2028<\\u20281) === true'); +} + +//CHECK#9 +if (eval("0\u2029<\u20291") !== true) { + $ERROR('#9: (0\\u2029<\\u20291) === true'); +} + +//CHECK#10 +if (eval("0\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029<\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291") !== true) { + $ERROR('#10: (0\\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.8/11.8.1/S11.8.1_A2.1_T1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.1_T1.js new file mode 100644 index 000000000..4bcd448cb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.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.8/11.8.1/S11.8.1_A2.1_T1.js + * @description Either Type is not Reference or GetBase is not null + */ + +//CHECK#1 +if (1 < 2 !== true) { + $ERROR('#1: 1 < 2 === true'); +} + +//CHECK#2 +var x = 1; +if (x < 2 !== true) { + $ERROR('#2: var x = 1; x < 2 === true'); +} + +//CHECK#3 +var y = 2; +if (1 < y !== true) { + $ERROR('#3: var y = 2; 1 < y === true'); +} + +//CHECK#4 +var x = 1; +var y = 2; +if (x < y !== true) { + $ERROR('#4: var x = 1; var y = 2; x < y === true'); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objectx.prop = 1; +objecty.prop = 2; +if (objectx.prop < objecty.prop !== true) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 1; objecty.prop = 2; objectx.prop < objecty.prop === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.1_T2.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.1_T2.js new file mode 100644 index 000000000..591c7a7a5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.1_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x < y uses GetValue + * + * @path ch11/11.8/11.8.1/S11.8.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.8/11.8.1/S11.8.1_A2.1_T3.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.1_T3.js new file mode 100644 index 000000000..b71cac528 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.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.8/11.8.1/S11.8.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.8/11.8.1/S11.8.1_A2.2_T1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.2_T1.js new file mode 100644 index 000000000..8641cf4f2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.2_T1.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x < y uses [[Default Value]] + * + * @path ch11/11.8/11.8.1/S11.8.1_A2.2_T1.js + * @description If Type(value) is Object, evaluate ToPrimitive(value, Number) + */ + +//CHECK#1 +if ({valueOf: function() {return 0}} < 1 !== true) { + $ERROR('#1: {valueOf: function() {return 1}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}} < 1)); +} + +//CHECK#2 +if ({valueOf: function() {return 0}, toString: function() {return 2}} < 1 !== true) { + $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} < 1)); +} + +//CHECK#3 +if ({valueOf: function() {return 0}, toString: function() {return {}}} < 1 !== true) { + $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} < 1)); +} + +//CHECK#4 +try { + if ({valueOf: function() {return 0}, toString: function() {throw "error"}} < 1 !== true) { + $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw "error"}} < 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw "error"}} < 1)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: {valueOf: function() {return 0}, toString: function() {throw "error"}} < 1 not throw "error"'); + } else { + $ERROR('#4.3: {valueOf: function() {return 0}, toString: function() {throw "error"}} < 1 not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if (1 < {toString: function() {return 2}} !== true) { + $ERROR('#5: 1 < {toString: function() {return 2}} === true. Actual: ' + (1 < {toString: function() {return 2}})); +} + +//CHECK#6 +if (1 < {valueOf: function() {return {}}, toString: function() {return 2}} !== true) { + $ERROR('#6: 1 < {valueOf: function() {return {}}, toString: function() {return 2}} === true. Actual: ' + (1 < {valueOf: function() {return {}}, toString: function() {return 2}})); +} + +//CHECK#7 +try { + 1 < {valueOf: function() {throw "error"}, toString: function() {return 2}}; + $ERROR('#7.1: 1 < {valueOf: function() {throw "error"}, toString: function() {return 2}} throw "error". Actual: ' + (1 < {valueOf: function() {throw "error"}, toString: function() {return 2}})); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: 1 < {valueOf: function() {throw "error"}, toString: function() {return 2}} 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.8/11.8.1/S11.8.1_A2.3_T1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.3_T1.js new file mode 100644 index 000000000..9f7c478ca --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.3_T1.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. + +/** + * ToNumber(first expression) is called first, and then ToNumber(second expression) + * + * @path ch11/11.8/11.8.1/S11.8.1_A2.3_T1.js + * @description Checking with "throw" + */ + +//CHECK#1 +var x = { valueOf: function () { throw "x"; } }; +var y = { valueOf: function () { throw "y"; } }; +try { + x < y; + $ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x < y throw "x". Actual: ' + (x < y)); +} catch (e) { + if (e === "y") { + $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)'); + } else { + if (e !== "x") { + $ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x < y throw "x". Actual: ' + (e)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.4_T1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.4_T1.js new file mode 100644 index 000000000..739640488 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.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.8/11.8.1/S11.8.1_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var x = 1; +if ((x = 0) < x !== false) { + $ERROR('#1: var x = 1; (x = 0) < 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.8/11.8.1/S11.8.1_A2.4_T2.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.4_T2.js new file mode 100644 index 000000000..acd8c1274 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.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.8/11.8.1/S11.8.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.8/11.8.1/S11.8.1_A2.4_T3.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A2.4_T3.js new file mode 100644 index 000000000..657ef95f2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.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.8/11.8.1/S11.8.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 !== false) { + $ERROR('#2: (y = 1) < y === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.1.js new file mode 100644 index 000000000..0d01c8f9f --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object + */ + +//CHECK#1 +if (true < true !== false) { + $ERROR('#1: true < true === false'); +} + +//CHECK#2 +if (new Boolean(true) < true !== false) { + $ERROR('#2: new Boolean(true) < true === false'); +} + +//CHECK#3 +if (true < new Boolean(true) !== false) { + $ERROR('#3: true < new Boolean(true) === false'); +} + +//CHECK#4 +if (new Boolean(true) < new Boolean(true) !== false) { + $ERROR('#4: new Boolean(true) < new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.2.js new file mode 100644 index 000000000..afec980fd --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.2.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(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object + */ + +//CHECK#1 +if (1 < 1 !== false) { + $ERROR('#1: 1 < 1 === false'); +} + +//CHECK#2 +if (new Number(1) < 1 !== false) { + $ERROR('#2: new Number(1) < 1 === false'); +} + +//CHECK#3 +if (1 < new Number(1) !== false) { + $ERROR('#3: 1 < new Number(1) === false'); +} + +//CHECK#4 +if (new Number(1) < new Number(1) !== false) { + $ERROR('#4: new Number(1) < new Number(1) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.3.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.3.js new file mode 100644 index 000000000..7964cd27d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T1.3.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T1.3.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined + */ + +//CHECK#1 +if (null < undefined !== false) { + $ERROR('#1: null < undefined === false'); +} + +//CHECK#2 +if (undefined < null !== false) { + $ERROR('#2: undefined < null === false'); +} + +//CHECK#3 +if (undefined < undefined !== false) { + $ERROR('#3: undefined < undefined === false'); +} + +//CHECK#4 +if (null < null !== false) { + $ERROR('#4: null < null === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.1.js new file mode 100644 index 000000000..acbeb65db --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.1.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 Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.1.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types are Number (primitive or object) or Boolean (primitive and object) + */ + +//CHECK#1 +if (true < 1 !== false) { + $ERROR('#1: true < 1 === false'); +} + +//CHECK#2 +if (1 < true !== false) { + $ERROR('#2: 1 < true === false'); +} + +//CHECK#3 +if (new Boolean(true) < 1 !== false) { + $ERROR('#3: new Boolean(true) < 1 === false'); +} + +//CHECK#4 +if (1 < new Boolean(true) !== false) { + $ERROR('#4: 1 < new Boolean(true) === false'); +} + +//CHECK#5 +if (true < new Number(1) !== false) { + $ERROR('#5: true < new Number(1) === false'); +} + +//CHECK#6 +if (new Number(1) < true !== false) { + $ERROR('#6: new Number(1) < true === false'); +} + +//CHECK#7 +if (new Boolean(true) < new Number(1) !== false) { + $ERROR('#7: new Boolean(true) < new Number(1) === false'); +} + +//CHECK#8 +if (new Number(1) < new Boolean(true) !== false) { + $ERROR('#8: new Number(1) < new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.2.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.2.js new file mode 100644 index 000000000..e67f1c50a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.2.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.2.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object) + */ + +//CHECK#1 +if ("1" < 1 !== false) { + $ERROR('#1: "1" < 1 === false'); +} + +//CHECK#2 +if (1 < "1" !== false) { + $ERROR('#2: 1 < "1" === false'); +} + +//CHECK#3 +if (new String("1") < 1 !== false) { + $ERROR('#3: new String("1") < 1 === false'); +} + +//CHECK#4 +if (1 < new String("1") !== false) { + $ERROR('#4: 1 < new String("1") === false'); +} + +//CHECK#5 +if ("1" < new Number(1) !== false) { + $ERROR('#5: "1" < new Number(1) === false'); +} + +//CHECK#6 +if (new Number(1) < "1" !== false) { + $ERROR('#6: new Number(1) < "1" === false'); +} + +//CHECK#7 +if (new String("1") < new Number(1) !== false) { + $ERROR('#7: new String("1") < new Number(1) === false'); +} + +//CHECK#8 +if (new Number(1) < new String("1") !== false) { + $ERROR('#8: new Number(1) < new String("1") === false'); +} + +//CHECK#9 +if ("x" < 1 !== false) { + $ERROR('#9: "x" < 1 === false'); +} + +//CHECK#10 +if (1 < "x" !== false) { + $ERROR('#10: 1 < "x" === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.3.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.3.js new file mode 100644 index 000000000..32d4fa5fa --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.3.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.3.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null + */ + +//CHECK#1 +if (1 < null !== false) { + $ERROR('#1: 1 < null === false'); +} + +//CHECK#2 +if (null < 1 !== true) { + $ERROR('#2: null < 1 === true'); +} + +//CHECK#3 +if (new Number(1) < null !== false) { + $ERROR('#3: new Number(1) < null === false'); +} + +//CHECK#4 +if (null < new Number(1) !== true) { + $ERROR('#4: null < new Number(1) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.4.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.4.js new file mode 100644 index 000000000..19ce587cb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.4.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.4.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined + */ + +//CHECK#1 +if (1 < undefined !== false) { + $ERROR('#1: 1 < undefined === false'); +} + +//CHECK#2 +if (undefined < 1 !== false) { + $ERROR('#2: undefined < 1 === false'); +} + +//CHECK#3 +if (new Number(1) < undefined !== false) { + $ERROR('#3: new Number(1) < undefined === false'); +} + +//CHECK#4 +if (undefined < new Number(1) !== false) { + $ERROR('#4: undefined < new Number(1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.5.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.5.js new file mode 100644 index 000000000..2ec157c85 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.5.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 Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.5.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object) + */ + +//CHECK#1 +if (true < "1" !== false) { + $ERROR('#1: true < "1" === false'); +} + +//CHECK#2 +if ("1" < true !== false) { + $ERROR('#2: "1" < true === false'); +} + +//CHECK#3 +if (new Boolean(true) < "1" !== false) { + $ERROR('#3: new Boolean(true) < "1" === false'); +} + +//CHECK#4 +if ("1" < new Boolean(true) !== false) { + $ERROR('#4: "1" < new Boolean(true) === false'); +} + +//CHECK#5 +if (true < new String("1") !== false) { + $ERROR('#5: true < new String("1") === false'); +} + +//CHECK#6 +if (new String("1") < true !== false) { + $ERROR('#6: new String("1") < true === false'); +} + +//CHECK#7 +if (new Boolean(true) < new String("1") !== false) { + $ERROR('#7: new Boolean(true) < new String("1") === false'); +} + +//CHECK#8 +if (new String("1") < new Boolean(true) !== false) { + $ERROR('#8: new String("1") < new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.6.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.6.js new file mode 100644 index 000000000..de4ef0016 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.6.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.6.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined + */ + +//CHECK#1 +if ("1" < undefined !== false) { + $ERROR('#1: "1" < undefined === false'); +} + +//CHECK#2 +if (undefined < "1" !== false) { + $ERROR('#2: undefined < "1" === false'); +} + +//CHECK#3 +if (new String("1") < undefined !== false) { + $ERROR('#3: new String("1") < undefined === false'); +} + +//CHECK#4 +if (undefined < new String("1") !== false) { + $ERROR('#4: undefined < new String("1") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.7.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.7.js new file mode 100644 index 000000000..97e9c8fdd --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.7.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.7.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null + */ + +//CHECK#1 +if ("1" < null !== false) { + $ERROR('#1: "1" < null === false'); +} + +//CHECK#2 +if (null < "1" !== true) { + $ERROR('#2: null < "1" === true'); +} + +//CHECK#3 +if (new String("1") < null !== false) { + $ERROR('#3: new String("1") < null === false'); +} + +//CHECK#4 +if (null < new String("1") !== true) { + $ERROR('#4: null < new String("1") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.8.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.8.js new file mode 100644 index 000000000..dcd5dfef8 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.8.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.8.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined + */ + +//CHECK#1 +if (true < undefined !== false) { + $ERROR('#1: true < undefined === false'); +} + +//CHECK#2 +if (undefined < true !== false) { + $ERROR('#2: undefined < true === false'); +} + +//CHECK#3 +if (new Boolean(true) < undefined !== false) { + $ERROR('#3: new Boolean(true) < undefined === false'); +} + +//CHECK#4 +if (undefined < new Boolean(true) !== false) { + $ERROR('#4: undefined < new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.9.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.9.js new file mode 100644 index 000000000..3e47b7d07 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.1_T2.9.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x < y returns ToNumber(x) < ToNumber(y) + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.1_T2.9.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null + */ + +//CHECK#1 +if (true < null !== false) { + $ERROR('#1: true < null === false'); +} + +//CHECK#2 +if (null < true !== true) { + $ERROR('#2: null < true === true'); +} + +//CHECK#3 +if (new Boolean(true) < null !== false) { + $ERROR('#3: new Boolean(true) < null === false'); +} + +//CHECK#4 +if (null < new Boolean(true) !== true) { + $ERROR('#4: null < new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.2_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.2_T1.1.js new file mode 100644 index 000000000..9e1cb7811 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.2_T1.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. + +/** + * Operator x < y returns ToString(x) < ToString(y), if Type(Primitive(x)) is String and Type(Primitive(y)) is String + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.2_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object + */ + +//CHECK#1 +if ("1" < "1" !== false) { + $ERROR('#1: "1" < "1" === false'); +} + +//CHECK#2 +if (new String("1") < "1" !== false) { + $ERROR('#2: new String("1") < "1" === false'); +} + +//CHECK#3 +if ("1" < new String("1") !== false) { + $ERROR('#3: "1" < new String("1") === false'); +} + +//CHECK#4 +if (new String("1") < new String("1") !== false) { + $ERROR('#4: new String("1") < new String("1") === false'); +} + +//CHECK#5 +if ("x" < "1" !== false) { + $ERROR('#5: "x" < "1" === false'); +} + +//CHECK#6 +if ("1" < "x" !== true) { + $ERROR('#6: "1" < "x" === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.2_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.2_T1.2.js new file mode 100644 index 000000000..47068903b --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A3.2_T1.2.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. + +/** + * Operator x < y returns ToString(x) < ToString(y), if Type(Primitive(x)) is String and Type(Primitive(y)) is String + * + * @path ch11/11.8/11.8.1/S11.8.1_A3.2_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object + */ + +//CHECK#1 +if (({} < function(){return 1}) !== ({}.toString() < function(){return 1}.toString())) { + $ERROR('#1: ({} < function(){return 1}) === ({}.toString() < function(){return 1}.toString())'); +} + +//CHECK#2 +if ((function(){return 1} < {}) !== (function(){return 1}.toString() < {}.toString())) { + $ERROR('#2: (function(){return 1} < {}) === (function(){return 1}.toString() < {}.toString())'); +} + +//CHECK#3 +if ((function(){return 1} < function(){return 1}) !== (function(){return 1}.toString() < function(){return 1}.toString())) { + $ERROR('#3: (function(){return 1} < function(){return 1}) === (function(){return 1}.toString() < function(){return 1}.toString())'); +} + +//CHECK#4 +if (({} < {}) !== ({}.toString() < {}.toString())) { + $ERROR('#4: ({} < {}) === ({}.toString() < {}.toString())'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.1.js new file mode 100644 index 000000000..5dee6e657 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.1.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.1.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NaN < 0) !== false) { + $ERROR('#1: (NaN < 0) === false'); +} + +//CHECK#2 +if ((Number.NaN < 1.1) !== false) { + $ERROR('#2: (NaN < 1.1) === false'); +} + +//CHECK#3 +if ((Number.NaN < -1.1) !== false) { + $ERROR('#3: (NaN < -1.1) === false'); +} + +//CHECK#4 +if ((Number.NaN < Number.NaN) !== false) { + $ERROR('#4: (NaN < NaN) === false'); +} + +//CHECK#5 +if ((Number.NaN < Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (NaN < +Infinity) === false'); +} + +//CHECK#6 +if ((Number.NaN < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#6: (NaN < -Infinity) === false'); +} + +//CHECK#7 +if ((Number.NaN < Number.MAX_VALUE) !== false) { + $ERROR('#7: (NaN < Number.MAX_VALUE) === false'); +} + +//CHECK#8 +if ((Number.NaN < Number.MIN_VALUE) !== false) { + $ERROR('#8: (NaN < Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.10.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.10.js new file mode 100644 index 000000000..2caacdc42 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.10.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is a prefix of x, return false + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.10.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" < "x") !== false) { + $ERROR('#1: ("x" < "x") === false'); +} + +//CHECK#2 +if (("x" < "") !== false) { + $ERROR('#2: ("x" < "") === false'); +} + +//CHECK#3 +if (("abcd" < "ab") !== false) { + $ERROR('#3: ("abcd" < ab") === false'); +} + +//CHECK#4 +if (("abc\u0064" < "abcd") !== false) { + $ERROR('#4: ("abc\\u0064" < abcd") === false'); +} + +//CHECK#5 +if (("x" + "y" < "x") !== false) { + $ERROR('#5: ("x" + "y" < "x") === false'); +} + +//CHECK#6 +var x = "x"; +if ((x + "y" < x) !== false) { + $ERROR('#6: var x = "x"; (x + "y" < x) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.11.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.11.js new file mode 100644 index 000000000..2c87da030 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.11.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. + +/** + * If x is a prefix of y and x !== y, return true + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.11.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" < "x ") !== true) { + $ERROR('#1: ("x" < "x ") === true'); +} + +//CHECK#2 +if (("" < "x") !== true) { + $ERROR('#2: ("" < "x") === true'); +} + +//CHECK#3 +if (("ab" < "abcd") !== true) { + $ERROR('#3: ("ab" < abcd") === true'); +} + +//CHECK#4 +if (("abcd" < "abc\u0064") !== false) { + $ERROR('#4: ("abcd" < abc\\u0064") === false'); +} + +//CHECK#5 +if (("x" < "x" + "y") !== true) { + $ERROR('#5: ("x" < "x" + "y") === true'); +} + +//CHECK#6 +var x = "x"; +if ((x < x + "y") !== true) { + $ERROR('#6: var x = "x"; (x < x + "y") === true'); +} + +//CHECK#7 +if (("a\u0000" < "a\u0000a") !== true) { + $ERROR('#7: ("a\\u0000" < "a\\u0000a") === true'); +} + +//CHECK#8 +if (("x" < " x") !== false) { + $ERROR('#8: ("x" < " x") === false'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.12_T1.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.12_T1.js new file mode 100644 index 000000000..b8f0eb78d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.12_T1.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.12_T1.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("xx" < "xy") !== true) { + $ERROR('#1: ("xx" < "xy") === true'); +} + +//CHECK#2 +if (("xy" < "xx") !== false) { + $ERROR('#2: ("xy" < "xx") === false'); +} + +//CHECK#3 +if (("x" < "y") !== true) { + $ERROR('#3: ("x" < y") === true'); +} + +//CHECK#4 +if (("aab" < "aba") !== true) { + $ERROR('#4: ("aab" < aba") === true'); +} + +//CHECK#5 +if (("\u0061\u0061\u0061\u0062" < "\u0061\u0061\u0061\u0061") !== false) { + $ERROR('#5: ("\\u0061\\u0061\\u0061\\u0062" < \\u0061\\u0061\\u0061\\u0061") === false'); +} + +//CHECK#6 +if (("a\u0000a" < "a\u0000b") !== true) { + $ERROR('#6: ("a\\u0000a" < "a\\u0000b") === true'); +} + +//CHECK#7 +if (("aB" < "aa") !== true) { + $ERROR('#7: ("aB" < aa") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.12_T2.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.12_T2.js new file mode 100644 index 000000000..0b0e2d5fb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.12_T2.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.12_T2.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("0" < "x") !== true) { + $ERROR('#1: ("0" < "x") !== true'); +} + +//CHECK#2 +if (("-" < "0") !== true) { + $ERROR('#2: ("-" < "0") !== true'); +} + +//CHECK#3 +if (("." < "0") !== true) { + $ERROR('#3: ("." < "0") !== true'); +} + +//CHECK#4 +if (("+" < "-") !== true) { + $ERROR('#4: ("+" < "-") !== true'); +} + +//CHECK#5 +if (("-0" < "-1") !== true) { + $ERROR('#5: ("-0" < "-1") !== true'); +} + +//CHECK#6 +if (("+1" < "-1") !== true) { + $ERROR('#6: ("+1" < "-1") !== true'); +} + +//CHECK#7 +if (("1" < "1e-10") !== true) { +$ERROR('#7: ("1" < "1e-10") !== true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.2.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.2.js new file mode 100644 index 000000000..2ab4adeb4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.2.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.2.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 < Number.NaN) !== false) { + $ERROR('#1: (0 < NaN) === false'); +} + +//CHECK#2 +if ((1.1 < Number.NaN) !== false) { + $ERROR('#2: (1.1 < NaN) === false'); +} + +//CHECK#3 +if ((-1.1 < Number.NaN) !== false) { + $ERROR('#3: (-1.1 < NaN) === false'); +} + +//CHECK#4 +if ((Number.NaN < Number.NaN) !== false) { + $ERROR('#4: (NaN < NaN) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY < Number.NaN) !== false) { + $ERROR('#5: (+Infinity < NaN) === false'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY < Number.NaN) !== false) { + $ERROR('#6: (-Infinity < NaN) === false'); +} + +//CHECK#7 +if ((Number.MAX_VALUE < Number.NaN) !== false) { + $ERROR('#7: (Number.MAX_VALUE < NaN) === false'); +} + +//CHECK#8 +if ((Number.MIN_VALUE < Number.NaN) !== false) { + $ERROR('#8: (Number.MIN_VALUE < NaN) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.3.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.3.js new file mode 100644 index 000000000..1fa8a4988 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.3.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x and y are the same number value, return false + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.3.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1 < 1) !== false) { + $ERROR('#1: (1 < 1) === false'); +} + +//CHECK#2 +if ((1.1 < 1.1) !== false) { + $ERROR('#2: (1.1 < 1.1) === false'); +} + +//CHECK#3 +if ((-1.1 < -1.1) !== false) { + $ERROR('#3: (-1.1 < -1.1) === false'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#4: (-Infinity < -Infinity) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY < Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (+Infinity < +Infinity) === false'); +} + +//CHECK#6 +if ((Number.MAX_VALUE < Number.MAX_VALUE) !== false) { + $ERROR('#6: (Number.MAX_VALUE < Number.MAX_VALUE) === false'); +} + +//CHECK#7 +if ((Number.MIN_VALUE < Number.MIN_VALUE) !== false) { + $ERROR('#7: (Number.MIN_VALUE < Number.MIN_VALUE) === false'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.4.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.4.js new file mode 100644 index 000000000..d04541e42 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.4.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 x and y are +0 and -0, return false + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.4.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'); +} + +//CHECK#3 +if ((+0 < -0) !== false) { + $ERROR('#3: (+0 < -0) === false'); +} + +//CHECK#4 +if ((-0 < +0) !== false) { + $ERROR('#4: (-0 < +0) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.5.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.5.js new file mode 100644 index 000000000..d874e0fde --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.5.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +Infinity, return false + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.5.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.POSITIVE_INFINITY < 0) !== false) { + $ERROR('#1: (+Infinity < 0) === false'); +} + +//CHECK#2 +if ((Number.POSITIVE_INFINITY < 1.1) !== false) { + $ERROR('#2: (+Infinity < 1.1) === false'); +} + +//CHECK#3 +if ((Number.POSITIVE_INFINITY < -1.1) !== false) { + $ERROR('#3: (+Infinity < -1.1) === false'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#4: (+Infinity < -Infinity) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY < Number.MAX_VALUE) !== false) { + $ERROR('#5: (+Infinity < Number.MAX_VALUE) === false'); +} + +//CHECK#6 +if ((Number.POSITIVE_INFINITY < Number.MIN_VALUE) !== false) { + $ERROR('#6: (+Infinity < Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.6.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.6.js new file mode 100644 index 000000000..2dce0a45a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.6.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is +Infinity and x !== y, return true + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.6.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 < Number.POSITIVE_INFINITY) !== true) { + $ERROR('#1: (0 < +Infinity) === true'); +} + +//CHECK#2 +if ((1.1 < Number.POSITIVE_INFINITY) !== true) { + $ERROR('#2: (1.1 < +Infinity) === true'); +} + +//CHECK#3 +if ((-1.1 < Number.POSITIVE_INFINITY) !== true) { + $ERROR('#3: (-1.1 < +Infinity) === true'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY < Number.POSITIVE_INFINITY) !== true) { + $ERROR('#4: (-Infinity < +Infinity) === true'); +} + +//CHECK#5 +if ((Number.MAX_VALUE < Number.POSITIVE_INFINITY) !== true) { + $ERROR('#5: (Number.MAX_VALUE < +Infinity) === true'); +} + +//CHECK#6 +if ((Number.MIN_VALUE < Number.POSITIVE_INFINITY) !== true) { + $ERROR('#6: (Number.MIN_VALUE < +Infinity) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.7.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.7.js new file mode 100644 index 000000000..a54ec57be --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.7.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is -Infinity and x !== y, return true + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.7.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NEGATIVE_INFINITY < 0) !== true) { + $ERROR('#1: (-Infinity < 0) === true'); +} + +//CHECK#2 +if ((Number.NEGATIVE_INFINITY < 1.1) !== true) { + $ERROR('#2: (-Infinity < 1.1) === true'); +} + +//CHECK#3 +if ((Number.NEGATIVE_INFINITY < -1.1) !== true) { + $ERROR('#3: (-Infinity < -1.1) === true'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY < Number.POSITIVE_INFINITY) !== true) { + $ERROR('#4: (-Infinity < +Infinity) === true'); +} + +//CHECK#5 +if ((Number.NEGATIVE_INFINITY < Number.MAX_VALUE) !== true) { + $ERROR('#5: (-Infinity < Number.MAX_VALUE) === true'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY < Number.MIN_VALUE) !== true) { + $ERROR('#6: (-Infinity < Number.MIN_VALUE) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.8.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.8.js new file mode 100644 index 000000000..ac5202d5a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.8.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is -Infinity, return false + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.8.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#1: (0 < -Infinity) === false'); +} + +//CHECK#2 +if ((1.1 < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#2: (1.1 < -Infinity) === false'); +} + +//CHECK#3 +if ((-1.1 < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#3: (-1.1 < -Infinity) === false'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#4: (+Infinity < -Infinity) === false'); +} + +//CHECK#5 +if ((Number.MAX_VALUE < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#5: (Number.MAX_VALUE < -Infinity) === false'); +} + +//CHECK#6 +if ((Number.MIN_VALUE < Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#6: (Number.MIN_VALUE < -Infinity) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.9.js b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.9.js new file mode 100644 index 000000000..32839492c --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/S11.8.1_A4.9.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is less than y and these values are both finite non-zero, return true; otherwise, return false + * + * @path ch11/11.8/11.8.1/S11.8.1_A4.9.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1.1 < 1) !== false) { + $ERROR('#1: (1.1 < 1) === false'); +} + +//CHECK#2 +if ((1 < 1.1) !== true) { + $ERROR('#2: (1 < 1.1) === true'); +} + +//CHECK#3 +if ((-1.1 < -1) !== true) { + $ERROR('#3: (-1.1 < -1) === true'); +} + +//CHECK#4 +if ((-1 < -1.1) !== false) { + $ERROR('#4: (-1 < -1.1) === false'); +} + +//CHECK#5 +if ((0 < 0.1) !== true) { + $ERROR('#5: (0 < 0.1) === true'); +} + +//CHECK#6 +if ((-0.1 < 0) !== true) { + $ERROR('#6: (-0.1 < 0) === true'); +} + +//CHECK#7 +if ((Number.MAX_VALUE/2 < Number.MAX_VALUE) !== true) { + $ERROR('#7: (Number.MAX_VALUE/2 < Number.MAX_VALUE) === true'); +} + +//CHECK#8 +if ((Number.MIN_VALUE < Number.MIN_VALUE*2) !== true) { + $ERROR('#8: (Number.MIN_VALUE < Number.MIN_VALUE*2) === true'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/browser.js b/js/src/tests/test262/ch11/11.8/11.8.1/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/browser.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.1/shell.js b/js/src/tests/test262/ch11/11.8/11.8.1/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.1/shell.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-1.js b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-1.js new file mode 100644 index 000000000..97270dca2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-1.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.2/11.8.2-1.js
+ * @description 11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: valueOf > valueOf
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ valueOf: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ valueOf: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return !(obj1 > obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-2.js b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-2.js new file mode 100644 index 000000000..248452e99 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-2.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.2/11.8.2-2.js
+ * @description 11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: valueOf > toString
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ valueOf: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ toString: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return !(obj1 > obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-3.js b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-3.js new file mode 100644 index 000000000..b0db66533 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-3.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.2/11.8.2-3.js
+ * @description 11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: toString > valueOf
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ toString: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ valueOf: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return !(obj1 > obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-4.js b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-4.js new file mode 100644 index 000000000..50817010b --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/11.8.2-4.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.2/11.8.2-4.js
+ * @description 11.8.2 Greater-than Operator - Partial left to right order enforced when using Greater-than operator: toString > toString
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ toString: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ toString: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return !(obj1 > obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A1.js new file mode 100644 index 000000000..e2d072282 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.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 RelationalExpression and ">" or ">" and ShiftExpression are allowed + * + * @path ch11/11.8/11.8.2/S11.8.2_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("0\u0009>\u00091") !== false) { + $ERROR('#1: 0\\u0009>\\u00091) === false'); +} + +//CHECK#2 +if (eval("0\u000B>\u000B1") !== false) { + $ERROR('#2: 0\\u000B>\\u000B1) === false'); +} + +//CHECK#3 +if (eval("0\u000C>\u000C1") !== false) { + $ERROR('#3: (0\\u000C>\\u000C1) === false'); +} + +//CHECK#4 +if (eval("0\u0020>\u00201") !== false) { + $ERROR('#4: (0\\u0020>\\u00201) === false'); +} + +//CHECK#5 +if (eval("0\u00A0>\u00A01") !== false) { + $ERROR('#5: (0\\u00A0>\\u00A01) === false'); +} + +//CHECK#6 +if (eval("0\u000A>\u000A1") !== false) { + $ERROR('#6: (0\\u000A>\\u000A1) === false'); +} + +//CHECK#7 +if (eval("0\u000D>\u000D1") !== false) { + $ERROR('#7: (0\\u000D>\\u000D1) === false'); +} + +//CHECK#8 +if (eval("0\u2028>\u20281") !== false) { + $ERROR('#8: (0\\u2028>\\u20281) === false'); +} + +//CHECK#9 +if (eval("0\u2029>\u20291") !== false) { + $ERROR('#9: (0\\u2029>\\u20291) === false'); +} + +//CHECK#10 +if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029>=\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291") !== true) { + $ERROR('#10: (1\\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.8/11.8.2/S11.8.2_A2.1_T1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.1_T1.js new file mode 100644 index 000000000..9ae91af51 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.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.8/11.8.2/S11.8.2_A2.1_T1.js + * @description Either Type is not Reference or GetBase is not null + */ + +//CHECK#1 +if (2 > 1 !== true) { + $ERROR('#1: 2 > 1 === true'); +} + +//CHECK#2 +var x = 2; +if (x > 1 !== true) { + $ERROR('#2: var x = 2; x > 1 === true'); +} + +//CHECK#3 +var y = 1; +if (2 > y !== true) { + $ERROR('#3: var y = 1; 2 > y === true'); +} + +//CHECK#4 +var x = 2; +var y = 1; +if (x > y !== true) { + $ERROR('#4: var x = 2; var y = 1; x > y === true'); +} + +//CHECK#5 +var objectx = new Object(); +var objecty = new Object(); +objectx.prop = 2; +objecty.prop = 1; +if (objectx.prop > objecty.prop !== true) { + $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objectx.prop = 2; objecty.prop = 1; objectx.prop > objecty.prop === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.1_T2.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.1_T2.js new file mode 100644 index 000000000..c6c0a2c71 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.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.8/11.8.2/S11.8.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.8/11.8.2/S11.8.2_A2.1_T3.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.1_T3.js new file mode 100644 index 000000000..bf7dfc5e7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.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.8/11.8.2/S11.8.2_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.8/11.8.2/S11.8.2_A2.2_T1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.2_T1.js new file mode 100644 index 000000000..e8d7595ba --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.2_T1.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x > y uses [[Default Value]] + * + * @path ch11/11.8/11.8.2/S11.8.2_A2.2_T1.js + * @description If Type(value) is Object, evaluate ToPrimitive(value, Number) + */ + +//CHECK#1 +if ({valueOf: function() {return 2}} > 1 !== true) { + $ERROR('#1: {valueOf: function() {return 1}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}} > 1)); +} + +//CHECK#2 +if ({valueOf: function() {return 2}, toString: function() {return 0}} > 1 !== true) { + $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 2}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 2}} > 1)); +} + +//CHECK#3 +if ({valueOf: function() {return 2}, toString: function() {return {}}} > 1 !== true) { + $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} > 1)); +} + +//CHECK#4 +try { + if ({valueOf: function() {return 2}, toString: function() {throw "error"}} > 1 !== true) { + $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw "error"}} > 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw "error"}} > 1)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: {valueOf: function() {return 2}, toString: function() {throw "error"}} > 1 not throw "error"'); + } else { + $ERROR('#4.3: {valueOf: function() {return 2}, toString: function() {throw "error"}} > 1 not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if (1 > {toString: function() {return 0}} !== true) { + $ERROR('#5: 1 > {toString: function() {return 0}} === true. Actual: ' + (1 > {toString: function() {return 0}})); +} + +//CHECK#6 +if (1 > {valueOf: function() {return {}}, toString: function() {return 0}} !== true) { + $ERROR('#6: 1 > {valueOf: function() {return {}}, toString: function() {return 0}} === true. Actual: ' + (1 > {valueOf: function() {return {}}, toString: function() {return 0}})); +} + +//CHECK#7 +try { + 1 > {valueOf: function() {throw "error"}, toString: function() {return 0}}; + $ERROR('#7.1: 1 > {valueOf: function() {throw "error"}, toString: function() {return 0}} throw "error". Actual: ' + (1 > {valueOf: function() {throw "error"}, toString: function() {return 0}})); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: 1 > {valueOf: function() {throw "error"}, toString: function() {return 0}} 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.8/11.8.2/S11.8.2_A2.3_T1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.3_T1.js new file mode 100644 index 000000000..ab2e5a0e5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.3_T1.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. + +/** + * In ES5, First expression should be evaluated first. + * + * @path ch11/11.8/11.8.2/S11.8.2_A2.3_T1.js + * @description Checking that operands of a "<" evaluate left-to-right + */ + +//CHECK#1 +var x = { valueOf: function () { throw "x"; } }; +var y = { valueOf: function () { throw "y"; } }; +try { + x > y; + $ERROR('#1.1: Should have thrown'); +} catch (e) { + if (e === "y") { + $ERROR('#1.2: First expression should be evaluated first'); + } else { + if (e !== "x") { + $ERROR('#1.3: Failed with: ' + e); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.4_T1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.4_T1.js new file mode 100644 index 000000000..ac5f1b540 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.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.8/11.8.2/S11.8.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 = 1; +if (x > (x = 0) !== true) { + $ERROR('#2: var x = 1; x > (x = 0) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.4_T2.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.4_T2.js new file mode 100644 index 000000000..274f117cb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.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.8/11.8.2/S11.8.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.8/11.8.2/S11.8.2_A2.4_T3.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A2.4_T3.js new file mode 100644 index 000000000..d3228fdce --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.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.8/11.8.2/S11.8.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.8/11.8.2/S11.8.2_A3.1_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.1.js new file mode 100644 index 000000000..4f69c859e --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object + */ + +//CHECK#1 +if (true > true !== false) { + $ERROR('#1: true > true === false'); +} + +//CHECK#2 +if (new Boolean(true) > true !== false) { + $ERROR('#2: new Boolean(true) > true === false'); +} + +//CHECK#3 +if (true > new Boolean(true) !== false) { + $ERROR('#3: true > new Boolean(true) === false'); +} + +//CHECK#4 +if (new Boolean(true) > new Boolean(true) !== false) { + $ERROR('#4: new Boolean(true) > new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.2.js new file mode 100644 index 000000000..2a076c6c6 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.2.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(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object + */ + +//CHECK#1 +if (1 > 1 !== false) { + $ERROR('#1: 1 > 1 === false'); +} + +//CHECK#2 +if (new Number(1) > 1 !== false) { + $ERROR('#2: new Number(1) > 1 === false'); +} + +//CHECK#3 +if (1 > new Number(1) !== false) { + $ERROR('#3: 1 > new Number(1) === false'); +} + +//CHECK#4 +if (new Number(1) > new Number(1) !== false) { + $ERROR('#4: new Number(1) > new Number(1) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.3.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.3.js new file mode 100644 index 000000000..597266349 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T1.3.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T1.3.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined + */ + +//CHECK#1 +if (null > undefined !== false) { + $ERROR('#1: null > undefined === false'); +} + +//CHECK#2 +if (undefined > null !== false) { + $ERROR('#2: undefined > null === false'); +} + +//CHECK#3 +if (undefined > undefined !== false) { + $ERROR('#3: undefined > undefined === false'); +} + +//CHECK#4 +if (null > null !== false) { + $ERROR('#4: null > null === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.1.js new file mode 100644 index 000000000..81ba83400 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.1.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 Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.1.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Boolean (primitive and object) + */ + +//CHECK#1 +if (true > 1 !== false) { + $ERROR('#1: true > 1 === false'); +} + +//CHECK#2 +if (1 > true !== false) { + $ERROR('#2: 1 > true === false'); +} + +//CHECK#3 +if (new Boolean(true) > 1 !== false) { + $ERROR('#3: new Boolean(true) > 1 === false'); +} + +//CHECK#4 +if (1 > new Boolean(true) !== false) { + $ERROR('#4: 1 > new Boolean(true) === false'); +} + +//CHECK#5 +if (true > new Number(1) !== false) { + $ERROR('#5: true > new Number(1) === false'); +} + +//CHECK#6 +if (new Number(1) > true !== false) { + $ERROR('#6: new Number(1) > true === false'); +} + +//CHECK#7 +if (new Boolean(true) > new Number(1) !== false) { + $ERROR('#7: new Boolean(true) > new Number(1) === false'); +} + +//CHECK#8 +if (new Number(1) > new Boolean(true) !== false) { + $ERROR('#8: new Number(1) > new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.2.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.2.js new file mode 100644 index 000000000..4d6f8fc81 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.2.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.2.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object) + */ + +//CHECK#1 +if ("1" > 1 !== false) { + $ERROR('#1: "1" > 1 === false'); +} + +//CHECK#2 +if (1 > "1" !== false) { + $ERROR('#2: 1 > "1" === false'); +} + +//CHECK#3 +if (new String("1") > 1 !== false) { + $ERROR('#3: new String("1") > 1 === false'); +} + +//CHECK#4 +if (1 > new String("1") !== false) { + $ERROR('#4: 1 > new String("1") === false'); +} + +//CHECK#5 +if ("1" > new Number(1) !== false) { + $ERROR('#5: "1" > new Number(1) === false'); +} + +//CHECK#6 +if (new Number(1) > "1" !== false) { + $ERROR('#6: new Number(1) > "1" === false'); +} + +//CHECK#7 +if (new String("1") > new Number(1) !== false) { + $ERROR('#7: new String("1") > new Number(1) === false'); +} + +//CHECK#8 +if (new Number(1) > new String("1") !== false) { + $ERROR('#8: new Number(1) > new String("1") === false'); +} + +//CHECK#9 +if ("x" > 1 !== false) { + $ERROR('#9: "x" > 1 === false'); +} + +//CHECK#10 +if (1 > "x" !== false) { + $ERROR('#10: 1 > "x" === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.3.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.3.js new file mode 100644 index 000000000..63ec06aac --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.3.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.3.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null + */ + +//CHECK#1 +if (1 > null !== true) { + $ERROR('#1: 1 > null === true'); +} + +//CHECK#2 +if (null > 1 !== false) { + $ERROR('#2: null > 1 === false'); +} + +//CHECK#3 +if (new Number(1) > null !== true) { + $ERROR('#3: new Number(1) > null === true'); +} + +//CHECK#4 +if (null > new Number(1) !== false) { + $ERROR('#4: null > new Number(1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.4.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.4.js new file mode 100644 index 000000000..d98572cc5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.4.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.4.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined + */ + +//CHECK#1 +if (1 > undefined !== false) { + $ERROR('#1: 1 > undefined === false'); +} + +//CHECK#2 +if (undefined > 1 !== false) { + $ERROR('#2: undefined > 1 === false'); +} + +//CHECK#3 +if (new Number(1) > undefined !== false) { + $ERROR('#3: new Number(1) > undefined === false'); +} + +//CHECK#4 +if (undefined > new Number(1) !== false) { + $ERROR('#4: undefined > new Number(1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.5.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.5.js new file mode 100644 index 000000000..b739bd4dc --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.5.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 Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.5.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object) + */ + +//CHECK#1 +if (true > "1" !== false) { + $ERROR('#1: true > "1" === false'); +} + +//CHECK#2 +if ("1" > true !== false) { + $ERROR('#2: "1" > true === false'); +} + +//CHECK#3 +if (new Boolean(true) > "1" !== false) { + $ERROR('#3: new Boolean(true) > "1" === false'); +} + +//CHECK#4 +if ("1" > new Boolean(true) !== false) { + $ERROR('#4: "1" > new Boolean(true) === false'); +} + +//CHECK#5 +if (true > new String("1") !== false) { + $ERROR('#5: true > new String("1") === false'); +} + +//CHECK#6 +if (new String("1") > true !== false) { + $ERROR('#6: new String("1") > true === false'); +} + +//CHECK#7 +if (new Boolean(true) > new String("1") !== false) { + $ERROR('#7: new Boolean(true) > new String("1") === false'); +} + +//CHECK#8 +if (new String("1") > new Boolean(true) !== false) { + $ERROR('#8: new String("1") > new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.6.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.6.js new file mode 100644 index 000000000..839884f83 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.6.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.6.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined + */ + +//CHECK#1 +if ("1" > undefined !== false) { + $ERROR('#1: "1" > undefined === false'); +} + +//CHECK#2 +if (undefined > "1" !== false) { + $ERROR('#2: undefined > "1" === false'); +} + +//CHECK#3 +if (new String("1") > undefined !== false) { + $ERROR('#3: new String("1") > undefined === false'); +} + +//CHECK#4 +if (undefined > new String("1") !== false) { + $ERROR('#4: undefined > new String("1") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.7.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.7.js new file mode 100644 index 000000000..5b44d0a70 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.7.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.7.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null + */ + +//CHECK#1 +if ("1" > null !== true) { + $ERROR('#1: "1" > null === true'); +} + +//CHECK#2 +if (null > "1" !== false) { + $ERROR('#2: null > "1" === false'); +} + +//CHECK#3 +if (new String("1") > null !== true) { + $ERROR('#3: new String("1") > null === true'); +} + +//CHECK#4 +if (null > new String("1") !== false) { + $ERROR('#4: null > new String("1") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.8.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.8.js new file mode 100644 index 000000000..3a3c48e7a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.8.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.8.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined + */ + +//CHECK#1 +if (true > undefined !== false) { + $ERROR('#1: true > undefined === false'); +} + +//CHECK#2 +if (undefined > true !== false) { + $ERROR('#2: undefined > true === false'); +} + +//CHECK#3 +if (new Boolean(true) > undefined !== false) { + $ERROR('#3: new Boolean(true) > undefined === false'); +} + +//CHECK#4 +if (undefined > new Boolean(true) !== false) { + $ERROR('#4: undefined > new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.9.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.9.js new file mode 100644 index 000000000..32c04b23a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.1_T2.9.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x > y returns ToNumber(x) > ToNumber(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.1_T2.9.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null + */ + +//CHECK#1 +if (true > null !== true) { + $ERROR('#1: true > null === true'); +} + +//CHECK#2 +if (null > true !== false) { + $ERROR('#2: null > true === false'); +} + +//CHECK#3 +if (new Boolean(true) > null !== true) { + $ERROR('#3: new Boolean(true) > null === true'); +} + +//CHECK#4 +if (null > new Boolean(true) !== false) { + $ERROR('#4: null > new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.2_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.2_T1.1.js new file mode 100644 index 000000000..fb0bcb016 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.2_T1.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(Primitive(x)) is String and Type(Primitive(y)) is String, then operator x > y returns ToString(x) > ToString(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.2_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object + */ + +//CHECK#1 +if ("1" > "1" !== false) { + $ERROR('#1: "1" > "1" === false'); +} + +//CHECK#2 +if (new String("1") > "1" !== false) { + $ERROR('#2: new String("1") > "1" === false'); +} + +//CHECK#3 +if ("1" > new String("1") !== false) { + $ERROR('#3: "1" > new String("1") === false'); +} + +//CHECK#4 +if (new String("1") > new String("1") !== false) { + $ERROR('#4: new String("1") > new String("1") === false'); +} + +//CHECK#5 +if ("x" > "1" !== true) { + $ERROR('#5: "x" > "1" === true'); +} + +//CHECK#6 +if ("1" > "x" !== false) { + $ERROR('#6: "1" > "x" === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.2_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.2_T1.2.js new file mode 100644 index 000000000..cf6e2889b --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A3.2_T1.2.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. + +/** + * If Type(Primitive(x)) is String and Type(Primitive(y)) is String, then operator x > y returns ToString(x) > ToString(y) + * + * @path ch11/11.8/11.8.2/S11.8.2_A3.2_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object + */ + +//CHECK#1 +if (({} > function(){return 1}) !== ({}.toString() > function(){return 1}.toString())) { + $ERROR('#1: ({} > function(){return 1}) === ({}.toString() > function(){return 1}.toString())'); +} + +//CHECK#2 +if ((function(){return 1} > {}) !== (function(){return 1}.toString() > {}.toString())) { + $ERROR('#2: (function(){return 1} > {}) === (function(){return 1}.toString() > {}.toString())'); +} + +//CHECK#3 +if ((function(){return 1} > function(){return 1}) !== (function(){return 1}.toString() > function(){return 1}.toString())) { + $ERROR('#3: (function(){return 1} > function(){return 1}) === (function(){return 1}.toString() > function(){return 1}.toString())'); +} + +//CHECK#4 +if (({} > {}) !== ({}.toString() > {}.toString())) { + $ERROR('#4: ({} > {}) === ({}.toString() > {}.toString())'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.1.js new file mode 100644 index 000000000..a36cb0b92 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.1.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.1.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NaN > 0) !== false) { + $ERROR('#1: (NaN > 0) === false'); +} + +//CHECK#2 +if ((Number.NaN > 1.1) !== false) { + $ERROR('#2: (NaN > 1.1) === false'); +} + +//CHECK#3 +if ((Number.NaN > -1.1) !== false) { + $ERROR('#3: (NaN > -1.1) === false'); +} + +//CHECK#4 +if ((Number.NaN > Number.NaN) !== false) { + $ERROR('#4: (NaN > NaN) === false'); +} + +//CHECK#5 +if ((Number.NaN > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (NaN > +Infinity) === false'); +} + +//CHECK#6 +if ((Number.NaN > Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#6: (NaN > -Infinity) === false'); +} + +//CHECK#7 +if ((Number.NaN > Number.MAX_VALUE) !== false) { + $ERROR('#7: (NaN > Number.MAX_VALUE) === false'); +} + +//CHECK#8 +if ((Number.NaN > Number.MIN_VALUE) !== false) { + $ERROR('#8: (NaN > Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.10.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.10.js new file mode 100644 index 000000000..eef094d97 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.10.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is a prefix of y, return false + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.10.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" > "x") !== false) { + $ERROR('#1: ("x" > "x") === false'); +} + +//CHECK#2 +if (("" > "x") !== false) { + $ERROR('#2: ("" > "x") === false'); +} + +//CHECK#3 +if (("ab" > "abcd") !== false) { + $ERROR('#3: ("ab" > abcd") === false'); +} + +//CHECK#4 +if (("abcd" > "abc\u0064") !== false) { + $ERROR('#4: ("abcd" > abc\\u0064") === false'); +} + +//CHECK#5 +if (("x" > "x" + "y") !== false) { + $ERROR('#5: ("x" > "x" + "y") === false'); +} + +//CHECK#6 +var x = "x"; +if ((x > x + "y") !== false) { + $ERROR('#6: var x = "x"; (x > x + "y") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.11.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.11.js new file mode 100644 index 000000000..76da4cc14 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.11.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is a prefix of x and x !== y, return true + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.11.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x " > "x") !== true) { + $ERROR('#1: ("x " > "x") === true'); +} + +//CHECK#2 +if (("x" > "") !== true) { + $ERROR('#2: ("x" > "") === true'); +} + +//CHECK#3 +if (("abcd" > "ab") !== true) { + $ERROR('#3: ("abcd" > ab") === true'); +} + +//CHECK#4 +if (("abc\u0064" > "abcd") !== false) { + $ERROR('#4: ("abc\\u0064" > abc") === false'); +} + +//CHECK#5 +if (("x" + "y" > "x") !== true) { + $ERROR('#5: ("x" + "y" > "x") === true'); +} + +//CHECK#6 +var x = "x"; +if ((x + 'y' > x) !== true) { + $ERROR('#6: var x = "x"; (x + "y" > x) === true'); +} + +//CHECK#7 +if (("a\u0000a" > "a\u0000") !== true) { + $ERROR('#7: ("a\\u0000a" > "a\\u0000") === true'); +} + +//CHECK#8 +if ((" x" > "x") !== false) { + $ERROR('#8: (" x" > "x") === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.12_T1.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.12_T1.js new file mode 100644 index 000000000..4bd4fb2ab --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.12_T1.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.12_T1.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("xy" > "xx") !== true) { + $ERROR('#1: ("xy" > "xx") === true'); +} + +//CHECK#2 +if (("xx" > "xy") !== false) { + $ERROR('#2: ("xx" > "xy") === false'); +} + +//CHECK#3 +if (("y" > "x") !== true) { + $ERROR('#3: ("y" > "x") === true'); +} + +//CHECK#4 +if (("aba" > "aab") !== true) { + $ERROR('#4: ("aba" > aab") === true'); +} + +//CHECK#5 +if (("\u0061\u0061\u0061\u0061" > "\u0061\u0061\u0061\u0062") !== false) { + $ERROR('#5: ("\\u0061\\u0061\\u0061\\u0061" > \\u0061\\u0061\\u0061\\u0062") === false'); +} + +//CHECK#6 +if (("a\u0000b" > "a\u0000a") !== true) { + $ERROR('#6: ("a\\u0000b" > "a\\u0000a") === true'); +} + +//CHECK#7 +if (("aa" > "aB") !== true) { + $ERROR('#7: ("aa" > aB") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.12_T2.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.12_T2.js new file mode 100644 index 000000000..ab16d98cb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.12_T2.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.12_T2.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" > "0") !== true) { + $ERROR('#1: ("x" > "0") !== true'); +} + +//CHECK#2 +if (("0" > "-") !== true) { + $ERROR('#2: ("0" > "-") !== true'); +} + +//CHECK#3 +if (("0" > ".") !== true) { + $ERROR('#3: ("0" > ".") !== true'); +} + +//CHECK#4 +if (("-" > "+") !== true) { + $ERROR('#4: ("-" > "+") !== true'); +} + +//CHECK#5 +if (("-1" > "-0") !== true) { + $ERROR('#5: ("-1" > "-0") !== true'); +} + +//CHECK#6 +if (("-1" > "+1") !== true) { + $ERROR('#6: ("-1" > "+1") !== true'); +} + +//CHECK#7 +if (("1e-10" > "1") !== true) { +$ERROR('#7: ("1e-10" > "1") !== true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.2.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.2.js new file mode 100644 index 000000000..1e81c52fe --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.2.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.2.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 > Number.NaN) !== false) { + $ERROR('#1: (0 > NaN) === false'); +} + +//CHECK#2 +if ((1.1 > Number.NaN) !== false) { + $ERROR('#2: (1.1 > NaN) === false'); +} + +//CHECK#3 +if ((-1.1 > Number.NaN) !== false) { + $ERROR('#3: (-1.1 > NaN) === false'); +} + +//CHECK#4 +if ((Number.NaN > Number.NaN) !== false) { + $ERROR('#4: (NaN > NaN) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY > Number.NaN) !== false) { + $ERROR('#5: (+Infinity > NaN) === false'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY > Number.NaN) !== false) { + $ERROR('#6: (-Infinity > NaN) === false'); +} + +//CHECK#7 +if ((Number.MAX_VALUE > Number.NaN) !== false) { + $ERROR('#7: (Number.MAX_VALUE > NaN) === false'); +} + +//CHECK#8 +if ((Number.MIN_VALUE > Number.NaN) !== false) { + $ERROR('#8: (Number.MIN_VALUE > NaN) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.3.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.3.js new file mode 100644 index 000000000..8890a00e1 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.3.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x and y are the same number value, return false + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.3.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1 > 1) !== false) { + $ERROR('#1: (1 > 1) === false'); +} + +//CHECK#2 +if ((1.1 > 1.1) !== false) { + $ERROR('#2: (1.1 > 1.1) === false'); +} + +//CHECK#3 +if ((-1.1 > -1.1) !== false) { + $ERROR('#3: (-1.1 > -1.1) === false'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY > Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#4: (-Infinity > -Infinity) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (+Infinity > +Infinity) === false'); +} + +//CHECK#6 +if ((Number.MAX_VALUE > Number.MAX_VALUE) !== false) { + $ERROR('#6: (Number.MAX_VALUE > Number.MAX_VALUE) === false'); +} + +//CHECK#7 +if ((Number.MIN_VALUE > Number.MIN_VALUE) !== false) { + $ERROR('#7: (Number.MIN_VALUE > Number.MIN_VALUE) === false'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.4.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.4.js new file mode 100644 index 000000000..70a5440ca --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.4.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 either variable x or y is +0 and the other is -0, return false + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.4.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'); +} + +//CHECK#3 +if ((+0 > -0) !== false) { + $ERROR('#3: (+0 > -0) === false'); +} + +//CHECK#4 +if ((-0 > +0) !== false) { + $ERROR('#4: (-0 > +0) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.5.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.5.js new file mode 100644 index 000000000..79d3bde31 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.5.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +Infinity and x !== y, return true + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.5.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.POSITIVE_INFINITY > 0) !== true) { + $ERROR('#1: (+Infinity > 0) === true'); +} + +//CHECK#2 +if ((Number.POSITIVE_INFINITY > 1.1) !== true) { + $ERROR('#2: (+Infinity > 1.1) === true'); +} + +//CHECK#3 +if ((Number.POSITIVE_INFINITY > -1.1) !== true) { + $ERROR('#3: (+Infinity > -1.1) === true'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY > Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#4: (+Infinity > -Infinity) === true'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY > Number.MAX_VALUE) !== true) { + $ERROR('#5: (+Infinity > Number.MAX_VALUE) === true'); +} + +//CHECK#6 +if ((Number.POSITIVE_INFINITY > Number.MIN_VALUE) !== true) { + $ERROR('#6: (+Infinity > Number.MIN_VALUE) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.6.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.6.js new file mode 100644 index 000000000..aa96e699d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.6.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is +Infinity, return false + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.6.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#1: (0 > +Infinity) === false'); +} + +//CHECK#2 +if ((1.1 > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#2: (1.1 > +Infinity) === false'); +} + +//CHECK#3 +if ((-1.1 > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#3: (-1.1 > +Infinity) === false'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#4: (-Infinity > +Infinity) === false'); +} + +//CHECK#5 +if ((Number.MAX_VALUE > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (Number.MAX_VALUE > +Infinity) === false'); +} + +//CHECK#6 +if ((Number.MIN_VALUE > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#6: (Number.MIN_VALUE > +Infinity) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.7.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.7.js new file mode 100644 index 000000000..bc06818cc --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.7.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is -Infinity, return false + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.7.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NEGATIVE_INFINITY > 0) !== false) { + $ERROR('#1: (-Infinity > 0) === false'); +} + +//CHECK#2 +if ((Number.NEGATIVE_INFINITY > 1.1) !== false) { + $ERROR('#2: (-Infinity > 1.1) === false'); +} + +//CHECK#3 +if ((Number.NEGATIVE_INFINITY > -1.1) !== false) { + $ERROR('#3: (-Infinity > -1.1) === false'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY > Number.POSITIVE_INFINITY) !== false) { + $ERROR('#4: (-Infinity > +Infinity) === false'); +} + +//CHECK#5 +if ((Number.NEGATIVE_INFINITY > Number.MAX_VALUE) !== false) { + $ERROR('#5: (-Infinity > Number.MAX_VALUE) === false'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY > Number.MIN_VALUE) !== false) { + $ERROR('#6: (-Infinity > Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.8.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.8.js new file mode 100644 index 000000000..3a3156114 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.8.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is -Infinity and x !== y, return true + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.8.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 > Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#1: (0 > -Infinity) === true'); +} + +//CHECK#2 +if ((1.1 > Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#2: (1.1 > -Infinity) === true'); +} + +//CHECK#3 +if ((-1.1 > Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#3: (-1.1 > -Infinity) === true'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY > Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#4: (+Infinity > -Infinity) === true'); +} + +//CHECK#5 +if ((Number.MAX_VALUE > Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#5: (Number.MAX_VALUE > -Infinity) === true'); +} + +//CHECK#6 +if ((Number.MIN_VALUE > Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#6: (Number.MIN_VALUE > -Infinity) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.9.js b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.9.js new file mode 100644 index 000000000..a31255368 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/S11.8.2_A4.9.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If is x greater than y and these values are both finite non-zero, return true; otherwise, return false + * + * @path ch11/11.8/11.8.2/S11.8.2_A4.9.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1 > 1.1) !== false) { + $ERROR('#1: (1 > 1.1) === false'); +} + +//CHECK#2 +if ((1.1 > 1) !== true) { + $ERROR('#2: (1.1 > 1) === true'); +} + +//CHECK#3 +if ((-1 > -1.1) !== true) { + $ERROR('#3: (-1 > -1.1) === true'); +} + +//CHECK#4 +if ((-1.1 > -1) !== false) { + $ERROR('#4: (-1.1 > -1) === false'); +} + +//CHECK#5 +if ((0.1 > 0) !== true) { + $ERROR('#5: (0.1 > 0) === true'); +} + +//CHECK#6 +if ((0 > -0.1) !== true) { + $ERROR('#6: (0 > -0.1) === true'); +} + +//CHECK#7 +if ((Number.MAX_VALUE > Number.MAX_VALUE/2) !== true) { + $ERROR('#7: (Number.MAX_VALUE > Number.MAX_VALUE/2) === true'); +} + +//CHECK#8 +if ((Number.MIN_VALUE*2 > Number.MIN_VALUE) !== true) { + $ERROR('#8: (Number.MIN_VALUE*2 > Number.MIN_VALUE) === true'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/browser.js b/js/src/tests/test262/ch11/11.8/11.8.2/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/browser.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.2/shell.js b/js/src/tests/test262/ch11/11.8/11.8.2/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.2/shell.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-1.js b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-1.js new file mode 100644 index 000000000..4dc765ee2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-1.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.3/11.8.3-1.js
+ * @description 11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: valueOf <= valueOf
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ valueOf: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ valueOf: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return (obj1 <= obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-2.js b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-2.js new file mode 100644 index 000000000..0ff108b51 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-2.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.3/11.8.3-2.js
+ * @description 11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: valueOf <= toString
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ valueOf: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ toString: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return (obj1 <= obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-3.js b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-3.js new file mode 100644 index 000000000..2f5deae83 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-3.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.3/11.8.3-3.js
+ * @description 11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: toString <= valueOf
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ toString: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ valueOf: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return (obj1 <= obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-4.js b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-4.js new file mode 100644 index 000000000..9105f9e6f --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-4.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.3/11.8.3-4.js
+ * @description 11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: toString <= toString
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ toString: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ toString: function () {
+ if (accessed === true) {
+ return 4;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return (obj1 <= obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-5.js b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-5.js new file mode 100644 index 000000000..9356ff34e --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/11.8.3-5.js @@ -0,0 +1,31 @@ +/// Copyright (c) 2012 Ecma International. All rights reserved.
+/// Ecma International makes this code available under the terms and conditions set
+/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
+/// "Use Terms"). Any redistribution of this code must retain the above
+/// copyright and this notice and otherwise comply with the Use Terms.
+/**
+ * @path ch11/11.8/11.8.3/11.8.3-5.js
+ * @description 11.8.3 Less-than-or-equal Operator - Partial left to right order enforced when using Less-than-or-equal operator: valueOf <= valueOf
+ */
+
+
+function testcase() {
+ var accessed = false;
+ var obj1 = {
+ valueOf: function () {
+ accessed = true;
+ return 3;
+ }
+ };
+ var obj2 = {
+ valueOf: function () {
+ if (accessed === true) {
+ return 3;
+ } else {
+ return 2;
+ }
+ }
+ };
+ return (obj1 <= obj2);
+ }
+runTestCase(testcase);
diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A1.js new file mode 100644 index 000000000..905571139 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_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 RelationalExpression and "<=" or between "<=" and ShiftExpression are allowed + * + * @path ch11/11.8/11.8.3/S11.8.3_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("1\u0009<=\u00091") !== true) { + $ERROR('#1: (1\\u0009<=\\u00091) === true'); +} + +//CHECK#2 +if (eval("1\u000B<=\u000B1") !== true) { + $ERROR('#2: (1\\u000B<=\\u000B1) === true'); +} + +//CHECK#3 +if (eval("1\u000C<=\u000C1") !== true) { + $ERROR('#3: (1\\u000C<=\\u000C1) === true'); +} + +//CHECK#4 +if (eval("1\u0020<=\u00201") !== true) { + $ERROR('#4: (1\\u0020<=\\u00201) === true'); +} + +//CHECK#5 +if (eval("1\u00A0<=\u00A01") !== true) { + $ERROR('#5: (1\\u00A0<=\\u00A01) === true'); +} + +//CHECK#6 +if (eval("1\u000A<=\u000A1") !== true) { + $ERROR('#6: (1\\u000A<=\\u000A1) === true'); +} + +//CHECK#7 +if (eval("1\u000D<=\u000D1") !== true) { + $ERROR('#7: (1\\u000D<=\\u000D1) === true'); +} + +//CHECK#8 +if (eval("1\u2028<=\u20281") !== true) { + $ERROR('#8: (1\\u2028<=\\u20281) === true'); +} + +//CHECK#9 +if (eval("1\u2029<=\u20291") !== true) { + $ERROR('#9: (1\\u2029<=\\u20291) === true'); +} + +//CHECK#10 +if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029>\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== true) { + $ERROR('#10: (1\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029>\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.1_T1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.1_T1.js new file mode 100644 index 000000000..ddf5cde6d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_A2.1_T2.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.1_T2.js new file mode 100644 index 000000000..b767e2d95 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.1_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x <= y uses GetValue + * + * @path ch11/11.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_A2.1_T3.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.1_T3.js new file mode 100644 index 000000000..d2a4df17b --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_A2.2_T1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.2_T1.js new file mode 100644 index 000000000..fbc706a2f --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.2_T1.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x <= y uses [[Default Value]] + * + * @path ch11/11.8/11.8.3/S11.8.3_A2.2_T1.js + * @description If Type(value) is Object, evaluate ToPrimitive(value, Number) + */ + +//CHECK#1 +if ({valueOf: function() {return 0}} <= 1 !== true) { + $ERROR('#1: {valueOf: function() {return 1}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}} <= 1)); +} + +//CHECK#2 +if ({valueOf: function() {return 0}, toString: function() {return 2}} <= 1 !== true) { + $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 0}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 0}} <= 1)); +} + +//CHECK#3 +if ({valueOf: function() {return 0}, toString: function() {return {}}} <= 1 !== true) { + $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} <= 1)); +} + +//CHECK#4 +try { + if ({valueOf: function() {return 0}, toString: function() {throw "error"}} <= 1 !== true) { + $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw "error"}} <= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw "error"}} <= 1)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: {valueOf: function() {return 0}, toString: function() {throw "error"}} <= 1 not throw "error"'); + } else { + $ERROR('#4.3: {valueOf: function() {return 0}, toString: function() {throw "error"}} <= 1 not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if (1 <= {toString: function() {return 2}} !== true) { + $ERROR('#5: 1 <= {toString: function() {return 2}} === true. Actual: ' + (1 <= {toString: function() {return 2}})); +} + +//CHECK#6 +if (1 <= {valueOf: function() {return {}}, toString: function() {return 2}} !== true) { + $ERROR('#6: 1 <= {valueOf: function() {return {}}, toString: function() {return 2}} === true. Actual: ' + (1 <= {valueOf: function() {return {}}, toString: function() {return 2}})); +} + +//CHECK#7 +try { + 1 <= {valueOf: function() {throw "error"}, toString: function() {return 2}}; + $ERROR('#7.1: 1 <= {valueOf: function() {throw "error"}, toString: function() {return 2}} throw "error". Actual: ' + (1 <= {valueOf: function() {throw "error"}, toString: function() {return 2}})); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: 1 <= {valueOf: function() {throw "error"}, toString: function() {return 2}} 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.8/11.8.3/S11.8.3_A2.3_T1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.3_T1.js new file mode 100644 index 000000000..14ea37cc6 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.3_T1.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. + +/** + * In ES5, First expression should be evaluated first. + * + * @path ch11/11.8/11.8.3/S11.8.3_A2.3_T1.js + * @description Checking that operands of a "<=" evaluate left-to-right + */ + +//CHECK#1 +var x = { valueOf: function () { throw "x"; } }; +var y = { valueOf: function () { throw "y"; } }; +try { + x <= y; + $ERROR('#1.1: Should have thrown'); +} catch (e) { + if (e === "y") { + $ERROR('#1.2: First expression should be evaluated first'); + } else { + if (e !== "x") { + $ERROR('#1.3: Failed with: ' + e); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.4_T1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.4_T1.js new file mode 100644 index 000000000..81e29c531 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_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 = 1; +if (x <= (x = 0) !== false) { + $ERROR('#2: var x = 1; x <= (x = 0) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.4_T2.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.4_T2.js new file mode 100644 index 000000000..2cbb846ff --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_A2.4_T3.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A2.4_T3.js new file mode 100644 index 000000000..e53f08142 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_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.8/11.8.3/S11.8.3_A3.1_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.1.js new file mode 100644 index 000000000..a6a6f9dda --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object + */ + +//CHECK#1 +if (true <= true !== true) { + $ERROR('#1: true <= true === true'); +} + +//CHECK#2 +if (new Boolean(true) <= true !== true) { + $ERROR('#2: new Boolean(true) <= true === true'); +} + +//CHECK#3 +if (true <= new Boolean(true) !== true) { + $ERROR('#3: true <= new Boolean(true) === true'); +} + +//CHECK#4 +if (new Boolean(true) <= new Boolean(true) !== true) { + $ERROR('#4: new Boolean(true) <= new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.2.js new file mode 100644 index 000000000..e4a93112a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.2.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object + */ + +//CHECK#1 +if (1 <= 1 !== true) { + $ERROR('#1: 1 <= 1 === true'); +} + +//CHECK#2 +if (new Number(1) <= 1 !== true) { + $ERROR('#2: new Number(1) <= 1 === true'); +} + +//CHECK#3 +if (1 <= new Number(1) !== true) { + $ERROR('#3: 1 <= new Number(1) === true'); +} + +//CHECK#4 +if (new Number(1) <= new Number(1) !== true) { + $ERROR('#4: new Number(1) <= new Number(1) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.3.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.3.js new file mode 100644 index 000000000..c55bc154c --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T1.3.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T1.3.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined + */ + +//CHECK#1 +if (null <= undefined !== false) { + $ERROR('#1: null <= undefined === false'); +} + +//CHECK#2 +if (undefined <= null !== false) { + $ERROR('#2: undefined <= null === false'); +} + +//CHECK#3 +if (undefined <= undefined !== false) { + $ERROR('#3: undefined <= undefined === false'); +} + +//CHECK#4 +if (null <= null !== true) { + $ERROR('#4: null <= null === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.1.js new file mode 100644 index 000000000..2eb6f2282 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.1.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.1.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Boolean (primitive and object) + */ + +//CHECK#1 +if (true <= 1 !== true) { + $ERROR('#1: true <= 1 === true'); +} + +//CHECK#2 +if (1 <= true !== true) { + $ERROR('#2: 1 <= true === true'); +} + +//CHECK#3 +if (new Boolean(true) <= 1 !== true) { + $ERROR('#3: new Boolean(true) <= 1 === true'); +} + +//CHECK#4 +if (1 <= new Boolean(true) !== true) { + $ERROR('#4: 1 <= new Boolean(true) === true'); +} + +//CHECK#5 +if (true <= new Number(1) !== true) { + $ERROR('#5: true <= new Number(1) === true'); +} + +//CHECK#6 +if (new Number(1) <= true !== true) { + $ERROR('#6: new Number(1) <= true === true'); +} + +//CHECK#7 +if (new Boolean(true) <= new Number(1) !== true) { + $ERROR('#7: new Boolean(true) <= new Number(1) === true'); +} + +//CHECK#8 +if (new Number(1) <= new Boolean(true) !== true) { + $ERROR('#8: new Number(1) <= new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.2.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.2.js new file mode 100644 index 000000000..7bbff24f5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.2.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.2.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object) + */ + +//CHECK#1 +if ("1" <= 1 !== true) { + $ERROR('#1: "1" <= 1 === true'); +} + +//CHECK#2 +if (1 <= "1" !== true) { + $ERROR('#2: 1 <= "1" === true'); +} + +//CHECK#3 +if (new String("1") <= 1 !== true) { + $ERROR('#3: new String("1") <= 1 === true'); +} + +//CHECK#4 +if (1 <= new String("1") !== true) { + $ERROR('#4: 1 <= new String("1") === true'); +} + +//CHECK#5 +if ("1" <= new Number(1) !== true) { + $ERROR('#5: "1" <= new Number(1) === true'); +} + +//CHECK#6 +if (new Number(1) <= "1" !== true) { + $ERROR('#6: new Number(1) <= "1" === true'); +} + +//CHECK#7 +if (new String("1") <= new Number(1) !== true) { + $ERROR('#7: new String("1") <= new Number(1) === true'); +} + +//CHECK#8 +if (new Number(1) <= new String("1") !== true) { + $ERROR('#8: new Number(1) <= new String("1") === true'); +} + +//CHECK#9 +if ("x" <= 1 !== false) { + $ERROR('#9: "x" <= 1 === false'); +} + +//CHECK#10 +if (1 <= "x" !== false) { + $ERROR('#10: 1 <= "x" === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.3.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.3.js new file mode 100644 index 000000000..a255c8b99 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.3.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.3.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null + */ + +//CHECK#1 +if (1 <= null !== false) { + $ERROR('#1: 1 <= null === false'); +} + +//CHECK#2 +if (null <= 1 !== true) { + $ERROR('#2: null <= 1 === true'); +} + +//CHECK#3 +if (new Number(1) <= null !== false) { + $ERROR('#3: new Number(1) <= null === false'); +} + +//CHECK#4 +if (null <= new Number(1) !== true) { + $ERROR('#4: null <= new Number(1) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.4.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.4.js new file mode 100644 index 000000000..a124fb8d9 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.4.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.4.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined + */ + +//CHECK#1 +if (1 <= undefined !== false) { + $ERROR('#1: 1 <= undefined === false'); +} + +//CHECK#2 +if (undefined <= 1 !== false) { + $ERROR('#2: undefined <= 1 === false'); +} + +//CHECK#3 +if (new Number(1) <= undefined !== false) { + $ERROR('#3: new Number(1) <= undefined === false'); +} + +//CHECK#4 +if (undefined <= new Number(1) !== false) { + $ERROR('#4: undefined <= new Number(1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.5.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.5.js new file mode 100644 index 000000000..39fa250a5 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.5.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.5.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object) + */ + +//CHECK#1 +if (true <= "1" !== true) { + $ERROR('#1: true <= "1" === true'); +} + +//CHECK#2 +if ("1" <= true !== true) { + $ERROR('#2: "1" <= true === true'); +} + +//CHECK#3 +if (new Boolean(true) <= "1" !== true) { + $ERROR('#3: new Boolean(true) <= "1" === true'); +} + +//CHECK#4 +if ("1" <= new Boolean(true) !== true) { + $ERROR('#4: "1" <= new Boolean(true) === true'); +} + +//CHECK#5 +if (true <= new String("1") !== true) { + $ERROR('#5: true <= new String("1") === true'); +} + +//CHECK#6 +if (new String("1") <= true !== true) { + $ERROR('#6: new String("1") <= true === true'); +} + +//CHECK#7 +if (new Boolean(true) <= new String("1") !== true) { + $ERROR('#7: new Boolean(true) <= new String("1") === true'); +} + +//CHECK#8 +if (new String("1") <= new Boolean(true) !== true) { + $ERROR('#8: new String("1") <= new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.6.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.6.js new file mode 100644 index 000000000..321a4848e --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.6.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.6.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined + */ + +//CHECK#1 +if ("1" <= undefined !== false) { + $ERROR('#1: "1" <= undefined === false'); +} + +//CHECK#2 +if (undefined <= "1" !== false) { + $ERROR('#2: undefined <= "1" === false'); +} + +//CHECK#3 +if (new String("1") <= undefined !== false) { + $ERROR('#3: new String("1") <= undefined === false'); +} + +//CHECK#4 +if (undefined <= new String("1") !== false) { + $ERROR('#4: undefined <= new String("1") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.7.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.7.js new file mode 100644 index 000000000..02a69689e --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.7.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.7.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null + */ + +//CHECK#1 +if ("1" <= null !== false) { + $ERROR('#1: "1" <= null === false'); +} + +//CHECK#2 +if (null <= "1" !== true) { + $ERROR('#2: null <= "1" === true'); +} + +//CHECK#3 +if (new String("1") <= null !== false) { + $ERROR('#3: new String("1") <= null === false'); +} + +//CHECK#4 +if (null <= new String("1") !== true) { + $ERROR('#4: null <= new String("1") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.8.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.8.js new file mode 100644 index 000000000..580057063 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.8.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.8.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined + */ + +//CHECK#1 +if (true <= undefined !== false) { + $ERROR('#1: true <= undefined === false'); +} + +//CHECK#2 +if (undefined <= true !== false) { + $ERROR('#2: undefined <= true === false'); +} + +//CHECK#3 +if (new Boolean(true) <= undefined !== false) { + $ERROR('#3: new Boolean(true) <= undefined === false'); +} + +//CHECK#4 +if (undefined <= new Boolean(true) !== false) { + $ERROR('#4: undefined <= new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.9.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.9.js new file mode 100644 index 000000000..ed70b36f2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.1_T2.9.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. + +/** + * Operator x <= y returns ToNumber(x) <= ToNumber(y), if Type(Primitive(x)) is not String or Type(Primitive(y)) is not String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.1_T2.9.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null + */ + +//CHECK#1 +if (true <= null !== false) { + $ERROR('#1: true <= null === false'); +} + +//CHECK#2 +if (null <= true !== true) { + $ERROR('#2: null <= true === true'); +} + +//CHECK#3 +if (new Boolean(true) <= null !== false) { + $ERROR('#3: new Boolean(true) <= null === false'); +} + +//CHECK#4 +if (null <= new Boolean(true) !== true) { + $ERROR('#4: null <= new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.2_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.2_T1.1.js new file mode 100644 index 000000000..354384ea8 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.2_T1.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. + +/** + * Operator x <= y returns ToString(x) <= ToString(y), if Type(Primitive(x)) is String and Type(Primitive(y)) is String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.2_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object + */ + +//CHECK#1 +if ("1" <= "1" !== true) { + $ERROR('#1: "1" <= "1" === true'); +} + +//CHECK#2 +if (new String("1") <= "1" !== true) { + $ERROR('#2: new String("1") <= "1" === true'); +} + +//CHECK#3 +if ("1" <= new String("1") !== true) { + $ERROR('#3: "1" <= new String("1") === true'); +} + +//CHECK#4 +if (new String("1") <= new String("1") !== true) { + $ERROR('#4: new String("1") <= new String("1") === true'); +} + +//CHECK#5 +if ("x" <= "1" !== false) { + $ERROR('#5: "x" <= "1" === false'); +} + +//CHECK#6 +if ("1" <= "x" !== true) { + $ERROR('#6: "1" <= "x" === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.2_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.2_T1.2.js new file mode 100644 index 000000000..93ff5e2e2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A3.2_T1.2.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. + +/** + * Operator x <= y returns ToString(x) <= ToString(y), if Type(Primitive(x)) is String and Type(Primitive(y)) is String + * + * @path ch11/11.8/11.8.3/S11.8.3_A3.2_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object + */ + +//CHECK#1 +if (({} <= function(){return 1}) !== ({}.toString() <= function(){return 1}.toString())) { + $ERROR('#1: ({} <= function(){return 1}) === ({}.toString() <= function(){return 1}.toString())'); +} + +//CHECK#2 +if ((function(){return 1} <= {}) !== (function(){return 1}.toString() <= {}.toString())) { + $ERROR('#2: (function(){return 1} <= {}) === (function(){return 1}.toString() <= {}.toString())'); +} + +//CHECK#3 +if ((function(){return 1} <= function(){return 1}) !== (function(){return 1}.toString() <= function(){return 1}.toString())) { + $ERROR('#3: (function(){return 1} <= function(){return 1}) === (function(){return 1}.toString() <= function(){return 1}.toString())'); +} + +//CHECK#4 +if (({} <= {}) !== ({}.toString() <= {}.toString())) { + $ERROR('#4: ({} <= {}) === ({}.toString() <= {}.toString())'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.1.js new file mode 100644 index 000000000..c94f02041 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.1.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.1.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NaN <= 0) !== false) { + $ERROR('#1: (NaN <= 0) === false'); +} + +//CHECK#2 +if ((Number.NaN <= 1.1) !== false) { + $ERROR('#2: (NaN <= 1.1) === false'); +} + +//CHECK#3 +if ((Number.NaN <= -1.1) !== false) { + $ERROR('#3: (NaN <= -1.1) === false'); +} + +//CHECK#4 +if ((Number.NaN <= Number.NaN) !== false) { + $ERROR('#4: (NaN <= NaN) === false'); +} + +//CHECK#5 +if ((Number.NaN <= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (NaN <= +Infinity) === false'); +} + +//CHECK#6 +if ((Number.NaN <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#6: (NaN <= -Infinity) === false'); +} + +//CHECK#7 +if ((Number.NaN <= Number.MAX_VALUE) !== false) { + $ERROR('#7: (NaN <= Number.MAX_VALUE) === false'); +} + +//CHECK#8 +if ((Number.NaN <= Number.MIN_VALUE) !== false) { + $ERROR('#8: (NaN <= Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.10.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.10.js new file mode 100644 index 000000000..4e2295c6d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.10.js @@ -0,0 +1,42 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is a prefix of x and x !== y, return false + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.10.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x " <= "x") !== false) { + $ERROR('#1: ("x " <= "x") === false'); +} + +//CHECK#2 +if (("x" <= "") !== false) { + $ERROR('#2: ("x" <= "") === false'); +} + +//CHECK#3 +if (("abcd" <= "ab") !== false) { + $ERROR('#3: ("abcd" <= ab") === false'); +} + +//CHECK#4 +if (("abc\u0064" <= "abcd") !== true) { + $ERROR('#4: ("abc\\u0064" <= abcd") === true'); +} + +//CHECK#5 +if (("x" + "y" <= "x") !== false) { + $ERROR('#5: ("x" + "y" <= "x") === false'); +} + +//CHECK#6 +var x = "x"; +if ((x + 'y' <= x) !== false) { + $ERROR('#6: var x = "x"; (x + "y" <= x) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.11.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.11.js new file mode 100644 index 000000000..556a9eb89 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.11.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. + +/** + * If x is a prefix of y, return true + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.11.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" <= "x") !== true) { + $ERROR('#1: ("x" <= "x") === true'); +} + +//CHECK#2 +if (("" <= "x") !== true) { + $ERROR('#2: ("" <= "x") === true'); +} + +//CHECK#3 +if (("ab" <= "abcd") !== true) { + $ERROR('#3: ("ab" <= abcd") === true'); +} + +//CHECK#4 +if (("abcd" <= "abc\u0064") !== true) { + $ERROR('#4: ("abcd" <= abc\\u0064") === true'); +} + +//CHECK#5 +if (("x" <= "x" + "y") !== true) { + $ERROR('#5: ("x" <= "x" + "y") === true'); +} + +//CHECK#6 +var x = "x"; +if ((x <= x + "y") !== true) { + $ERROR('#6: var x = "x"; (x <= x + "y") === true'); +} + +//CHECK#7 +if (("a\u0000" <= "a\u0000a") !== true) { + $ERROR('#7: ("a\\u0000" <= "a\\u0000a") === true'); +} + +//CHECK#8 +if (("x" <= " x") !== false) { + $ERROR('#8: ("x" <= " x") === false'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.12_T1.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.12_T1.js new file mode 100644 index 000000000..cb1228e57 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.12_T1.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.12_T1.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("xx" <= "xy") !== true) { + $ERROR('#1: ("xx" <= "xy") === true'); +} + +//CHECK#2 +if (("xy" <= "xx") !== false) { + $ERROR('#2: ("xy" <= "xx") === false'); +} + +//CHECK#3 +if (("x" <= "y") !== true) { + $ERROR('#3: ("x" <= y") === true'); +} + +//CHECK#4 +if (("aab" <= "aba") !== true) { + $ERROR('#4: ("aab" <= aba") === true'); +} + +//CHECK#5 +if (("\u0061\u0061\u0061\u0062" <= "\u0061\u0061\u0061\u0061") !== false) { + $ERROR('#5: ("\\u0061\\u0061\\u0061\\u0062" <= \\u0061\\u0061\\u0061\\u0061") === false'); +} + +//CHECK#6 +if (("a\u0000a" <= "a\u0000b") !== true) { + $ERROR('#6: ("a\\u0000a" <= "a\\u0000b") === true'); +} + +//CHECK#7 +if (("aB" <= "aa") !== true) { + $ERROR('#7: ("aB" <= aa") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.12_T2.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.12_T2.js new file mode 100644 index 000000000..459d73ed1 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.12_T2.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.12_T2.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("0" <= "x") !== true) { + $ERROR('#1: ("0" <= "x") !== true'); +} + +//CHECK#2 +if (("-" <= "0") !== true) { + $ERROR('#2: ("-" <= "0") !== true'); +} + +//CHECK#3 +if (("." <= "0") !== true) { + $ERROR('#3: ("." <= "0") !== true'); +} + +//CHECK#4 +if (("+" <= "-") !== true) { + $ERROR('#4: ("+" <= "-") !== true'); +} + +//CHECK#5 +if (("-0" <= "-1") !== true) { + $ERROR('#5: ("-0" <= "-1") !== true'); +} + +//CHECK#6 +if (("+1" <= "-1") !== true) { + $ERROR('#6: ("+1" <= "-1") !== true'); +} + +//CHECK#7 +if (("1" <= "1e-10") !== true) { +$ERROR('#7: ("1" <= "1e-10") !== true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.2.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.2.js new file mode 100644 index 000000000..dd195d809 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.2.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.2.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 <= Number.NaN) !== false) { + $ERROR('#1: (0 <= NaN) === false'); +} + +//CHECK#2 +if ((1.1 <= Number.NaN) !== false) { + $ERROR('#2: (1.1 <= NaN) === false'); +} + +//CHECK#3 +if ((-1.1 <= Number.NaN) !== false) { + $ERROR('#3: (-1.1 <= NaN) === false'); +} + +//CHECK#4 +if ((Number.NaN <= Number.NaN) !== false) { + $ERROR('#4: (NaN <= NaN) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY <= Number.NaN) !== false) { + $ERROR('#5: (+Infinity <= NaN) === false'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY <= Number.NaN) !== false) { + $ERROR('#6: (-Infinity <= NaN) === false'); +} + +//CHECK#7 +if ((Number.MAX_VALUE <= Number.NaN) !== false) { + $ERROR('#7: (Number.MAX_VALUE <= NaN) === false'); +} + +//CHECK#8 +if ((Number.MIN_VALUE <= Number.NaN) !== false) { + $ERROR('#8: (Number.MIN_VALUE <= NaN) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.3.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.3.js new file mode 100644 index 000000000..3c462cfdd --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.3.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x and y are the same number value, return true + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.3.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1 <= 1) !== true) { + $ERROR('#1: (1 <= 1) === true'); +} + +//CHECK#2 +if ((1.1 <= 1.1) !== true) { + $ERROR('#2: (1.1 <= 1.1) === true'); +} + +//CHECK#3 +if ((-1.1 <= -1.1) !== true) { + $ERROR('#3: (-1.1 <= -1.1) === true'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY <= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#4: (-Infinity <= -Infinity) === true'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#5: (+Infinity <= +Infinity) === true'); +} + +//CHECK#6 +if ((Number.MAX_VALUE <= Number.MAX_VALUE) !== true) { + $ERROR('#6: (Number.MAX_VALUE <= Number.MAX_VALUE) === true'); +} + +//CHECK#7 +if ((Number.MIN_VALUE <= Number.MIN_VALUE) !== true) { + $ERROR('#7: (Number.MIN_VALUE <= Number.MIN_VALUE) === true'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.4.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.4.js new file mode 100644 index 000000000..4669cde36 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.4.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 either x or y is +0 and the other is -0, return true + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.4.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'); +} + +//CHECK#3 +if ((+0 <= -0) !== true) { + $ERROR('#3: (+0 <= -0) === true'); +} + +//CHECK#4 +if ((-0 <= +0) !== true) { + $ERROR('#4: (-0 <= +0) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.5.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.5.js new file mode 100644 index 000000000..ff3ab3a85 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.5.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +Infinity and x !== y, return false + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.5.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.POSITIVE_INFINITY <= 0) !== false) { + $ERROR('#1: (+Infinity <= 0) === false'); +} + +//CHECK#2 +if ((Number.POSITIVE_INFINITY <= 1.1) !== false) { + $ERROR('#2: (+Infinity <= 1.1) === false'); +} + +//CHECK#3 +if ((Number.POSITIVE_INFINITY <= -1.1) !== false) { + $ERROR('#3: (+Infinity <= -1.1) === false'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#4: (+Infinity <= -Infinity) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY <= Number.MAX_VALUE) !== false) { + $ERROR('#5: (+Infinity <= Number.MAX_VALUE) === false'); +} + +//CHECK#6 +if ((Number.POSITIVE_INFINITY <= Number.MIN_VALUE) !== false) { + $ERROR('#6: (+Infinity <= Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.6.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.6.js new file mode 100644 index 000000000..1aa11f973 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.6.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is +Infinity and x !== y, return true + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.6.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#1: (0 <= +Infinity) === true'); +} + +//CHECK#2 +if ((1.1 <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#2: (1.1 <= +Infinity) === true'); +} + +//CHECK#3 +if ((-1.1 <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#3: (-1.1 <= +Infinity) === true'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#4: (-Infinity <= +Infinity) === true'); +} + +//CHECK#5 +if ((Number.MAX_VALUE <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#5: (Number.MAX_VALUE <= +Infinity) === true'); +} + +//CHECK#6 +if ((Number.MIN_VALUE <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#6: (Number.MIN_VALUE <= +Infinity) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.7.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.7.js new file mode 100644 index 000000000..8abd94de4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.7.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is -Infinity, return true + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.7.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NEGATIVE_INFINITY <= 0) !== true) { + $ERROR('#1: (-Infinity <= 0) === true'); +} + +//CHECK#2 +if ((Number.NEGATIVE_INFINITY <= 1.1) !== true) { + $ERROR('#2: (-Infinity <= 1.1) === true'); +} + +//CHECK#3 +if ((Number.NEGATIVE_INFINITY <= -1.1) !== true) { + $ERROR('#3: (-Infinity <= -1.1) === true'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY <= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#4: (-Infinity <= +Infinity) === true'); +} + +//CHECK#5 +if ((Number.NEGATIVE_INFINITY <= Number.MAX_VALUE) !== true) { + $ERROR('#5: (-Infinity <= Number.MAX_VALUE) === true'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY <= Number.MIN_VALUE) !== true) { + $ERROR('#6: (-Infinity <= Number.MIN_VALUE) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.8.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.8.js new file mode 100644 index 000000000..c126d0795 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.8.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is -Infinity and x !== y, return false + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.8.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#1: (0 <= -Infinity) === false'); +} + +//CHECK#2 +if ((1.1 <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#2: (1.1 <= -Infinity) === false'); +} + +//CHECK#3 +if ((-1.1 <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#3: (-1.1 <= -Infinity) === false'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#4: (+Infinity <= -Infinity) === false'); +} + +//CHECK#5 +if ((Number.MAX_VALUE <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#5: (Number.MAX_VALUE <= -Infinity) === false'); +} + +//CHECK#6 +if ((Number.MIN_VALUE <= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#6: (Number.MIN_VALUE <= -Infinity) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.9.js b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.9.js new file mode 100644 index 000000000..fa0d9302c --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/S11.8.3_A4.9.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is less or equal than y and these values are both finite non-zero, return true; otherwise, return false + * + * @path ch11/11.8/11.8.3/S11.8.3_A4.9.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1.1 <= 1) !== false) { + $ERROR('#1: (1.1 <= 1) === false'); +} + +//CHECK#2 +if ((1 <= 1.1) !== true) { + $ERROR('#2: (1 <= 1.1) === true'); +} + +//CHECK#3 +if ((-1.1 <= -1) !== true) { + $ERROR('#3: (-1.1 <= -1) === true'); +} + +//CHECK#4 +if ((-1 <= -1.1) !== false) { + $ERROR('#4: (-1 <= -1.1) === false'); +} + +//CHECK#5 +if ((0 <= 0.1) !== true) { + $ERROR('#5: (0 <= 0.1) === true'); +} + +//CHECK#6 +if ((-0.1 <= 0) !== true) { + $ERROR('#6: (-0.1 <= 0) === true'); +} + +//CHECK#7 +if ((Number.MAX_VALUE/2 <= Number.MAX_VALUE) !== true) { + $ERROR('#7: (Number.MAX_VALUE/2 <= Number.MAX_VALUE) === true'); +} + +//CHECK#8 +if ((Number.MIN_VALUE <= Number.MIN_VALUE*2) !== true) { + $ERROR('#8: (Number.MIN_VALUE <= Number.MIN_VALUE*2) === true'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/browser.js b/js/src/tests/test262/ch11/11.8/11.8.3/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/browser.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.3/shell.js b/js/src/tests/test262/ch11/11.8/11.8.3/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.3/shell.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A1.js new file mode 100644 index 000000000..2a165a211 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.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 RelationalExpression and "=>" or "=>" and ShiftExpression are allowed + * + * @path ch11/11.8/11.8.4/S11.8.4_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("1\u0009>=\u00091") !== true) { + $ERROR('#1: (1\\u0009>=\\u00091) === true'); +} + +//CHECK#2 +if (eval("1\u000B>=\u000B1") !== true) { + $ERROR('#2: (1\\u000B>=\\u000B1) === true'); +} + +//CHECK#3 +if (eval("1\u000C>=\u000C1") !== true) { + $ERROR('#3: (1\\u000C>=\\u000C1) === true'); +} + +//CHECK#4 +if (eval("1\u0020>=\u00201") !== true) { + $ERROR('#4: (1\\u0020>=\\u00201) === true'); +} + +//CHECK#5 +if (eval("1\u00A0>=\u00A01") !== true) { + $ERROR('#5: (1\\u00A0>=\\u00A01) === true'); +} + +//CHECK#6 +if (eval("1\u000A>=\u000A1") !== true) { + $ERROR('#6: (1\\u000A>=\\u000A1) === true'); +} + +//CHECK#7 +if (eval("1\u000D>=\u000D1") !== true) { + $ERROR('#7: (1\\u000D>=\\u000D1) === true'); +} + +//CHECK#8 +if (eval("1\u2028>=\u20281") !== true) { + $ERROR('#8: (1\\u2028>=\\u20281) === true'); +} + +//CHECK#9 +if (eval("1\u2029>=\u20291") !== true) { + $ERROR('#9: (1\\u2029>=\\u20291) === true'); +} + +//CHECK#10 +if (eval("1\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029>=\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291") !== true) { + $ERROR('#10: (1\\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.8/11.8.4/S11.8.4_A2.1_T1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.1_T1.js new file mode 100644 index 000000000..8f3adb309 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_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.8/11.8.4/S11.8.4_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.8/11.8.4/S11.8.4_A2.1_T2.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.1_T2.js new file mode 100644 index 000000000..8a57a24e3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.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.8/11.8.4/S11.8.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.8/11.8.4/S11.8.4_A2.1_T3.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.1_T3.js new file mode 100644 index 000000000..23c2ea604 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.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.8/11.8.4/S11.8.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.8/11.8.4/S11.8.4_A2.2_T1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.2_T1.js new file mode 100644 index 000000000..f129ea315 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.2_T1.js @@ -0,0 +1,71 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator x >= y uses [[Default Value]] + * + * @path ch11/11.8/11.8.4/S11.8.4_A2.2_T1.js + * @description If Type(value) is Object, evaluate ToPrimitive(value, Number) + */ + +//CHECK#1 +if ({valueOf: function() {return 2}} >= 1 !== true) { + $ERROR('#1: {valueOf: function() {return 1}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}} >= 1)); +} + +//CHECK#2 +if ({valueOf: function() {return 2}, toString: function() {return 0}} >= 1 !== true) { + $ERROR('#2: {valueOf: function() {return 1}, toString: function() {return 2}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return 2}} >= 1)); +} + +//CHECK#3 +if ({valueOf: function() {return 2}, toString: function() {return {}}} >= 1 !== true) { + $ERROR('#3: {valueOf: function() {return 1}, toString: function() {return {}}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {return {}}} >= 1)); +} + +//CHECK#4 +try { + if ({valueOf: function() {return 2}, toString: function() {throw "error"}} >= 1 !== true) { + $ERROR('#4.1: {valueOf: function() {return 1}, toString: function() {throw "error"}} >= 1 === true. Actual: ' + ({valueOf: function() {return 1}, toString: function() {throw "error"}} >= 1)); + } +} +catch (e) { + if (e === "error") { + $ERROR('#4.2: {valueOf: function() {return 2}, toString: function() {throw "error"}} >= 1 not throw "error"'); + } else { + $ERROR('#4.3: {valueOf: function() {return 2}, toString: function() {throw "error"}} >= 1 not throw Error. Actual: ' + (e)); + } +} + +//CHECK#5 +if (1 >= {toString: function() {return 0}} !== true) { + $ERROR('#5: 1 >= {toString: function() {return 0}} === true. Actual: ' + (1 >= {toString: function() {return 0}})); +} + +//CHECK#6 +if (1 >= {valueOf: function() {return {}}, toString: function() {return 0}} !== true) { + $ERROR('#6: 1 >= {valueOf: function() {return {}}, toString: function() {return 0}} === true. Actual: ' + (1 >= {valueOf: function() {return {}}, toString: function() {return 0}})); +} + +//CHECK#7 +try { + 1 >= {valueOf: function() {throw "error"}, toString: function() {return 0}}; + $ERROR('#7.1: 1 >= {valueOf: function() {throw "error"}, toString: function() {return 0}} throw "error". Actual: ' + (1 >= {valueOf: function() {throw "error"}, toString: function() {return 0}})); +} +catch (e) { + if (e !== "error") { + $ERROR('#7.2: 1 >= {valueOf: function() {throw "error"}, toString: function() {return 0}} 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.8/11.8.4/S11.8.4_A2.3_T1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.3_T1.js new file mode 100644 index 000000000..dd286dd03 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.3_T1.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. + +/** + * ToNumber(first expression) is called first, and then ToNumber(second expression) + * + * @path ch11/11.8/11.8.4/S11.8.4_A2.3_T1.js + * @description Checking with "throw" + */ + +//CHECK#1 +var x = { valueOf: function () { throw "x"; } }; +var y = { valueOf: function () { throw "y"; } }; +try { + x >= y; + $ERROR('#1.1: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x >= y throw "x". Actual: ' + (x >= y)); +} catch (e) { + if (e === "y") { + $ERROR('#1.2: ToNumber(first expression) is called first, and then ToNumber(second expression)'); + } else { + if (e !== "x") { + $ERROR('#1.3: var x = { valueOf: function () { throw "x"; } }; var y = { valueOf: function () { throw "y"; } }; x >= y throw "x". Actual: ' + (e)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.4_T1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.4_T1.js new file mode 100644 index 000000000..8e3f2b0c7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.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.8/11.8.4/S11.8.4_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var x = 1; +if ((x = 0) >= x !== true) { + $ERROR('#1: var x = 1; (x = 0) >= 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.8/11.8.4/S11.8.4_A2.4_T2.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.4_T2.js new file mode 100644 index 000000000..f7c0446dd --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.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.8/11.8.4/S11.8.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.8/11.8.4/S11.8.4_A2.4_T3.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A2.4_T3.js new file mode 100644 index 000000000..54efe21ac --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.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.8/11.8.4/S11.8.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 !== true) { + $ERROR('#2: (y = 1) >= y === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.1.js new file mode 100644 index 000000000..d92463091 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive boolean and Boolean object + */ + +//CHECK#1 +if (true >= true !== true) { + $ERROR('#1: true >= true === true'); +} + +//CHECK#2 +if (new Boolean(true) >= true !== true) { + $ERROR('#2: new Boolean(true) >= true === true'); +} + +//CHECK#3 +if (true >= new Boolean(true) !== true) { + $ERROR('#3: true >= new Boolean(true) === true'); +} + +//CHECK#4 +if (new Boolean(true) >= new Boolean(true) !== true) { + $ERROR('#4: new Boolean(true) >= new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.2.js new file mode 100644 index 000000000..255124d7d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.2.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(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive number and Number object + */ + +//CHECK#1 +if (1 >= 1 !== true) { + $ERROR('#1: 1 >= 1 === true'); +} + +//CHECK#2 +if (new Number(1) >= 1 !== true) { + $ERROR('#2: new Number(1) >= 1 === true'); +} + +//CHECK#3 +if (1 >= new Number(1) !== true) { + $ERROR('#3: 1 >= new Number(1) === true'); +} + +//CHECK#4 +if (new Number(1) >= new Number(1) !== true) { + $ERROR('#4: new Number(1) >= new Number(1) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.3.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.3.js new file mode 100644 index 000000000..ffe39372e --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T1.3.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T1.3.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Null and Undefined + */ + +//CHECK#1 +if (null >= undefined !== false) { + $ERROR('#1: null >= undefined === false'); +} + +//CHECK#2 +if (undefined >= null !== false) { + $ERROR('#2: undefined >= null === false'); +} + +//CHECK#3 +if (undefined >= undefined !== false) { + $ERROR('#3: undefined >= undefined === false'); +} + +//CHECK#4 +if (null >= null !== true) { + $ERROR('#4: null >= null === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.1.js new file mode 100644 index 000000000..c1f367aae --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.1.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 Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.1.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Boolean (primitive and object) + */ + +//CHECK#1 +if (true >= 1 !== true) { + $ERROR('#1: true >= 1 === true'); +} + +//CHECK#2 +if (1 >= true !== true) { + $ERROR('#2: 1 >= true === true'); +} + +//CHECK#3 +if (new Boolean(true) >= 1 !== true) { + $ERROR('#3: new Boolean(true) >= 1 === true'); +} + +//CHECK#4 +if (1 >= new Boolean(true) !== true) { + $ERROR('#4: 1 >= new Boolean(true) === true'); +} + +//CHECK#5 +if (true >= new Number(1) !== true) { + $ERROR('#5: true >= new Number(1) === true'); +} + +//CHECK#6 +if (new Number(1) >= true !== true) { + $ERROR('#6: new Number(1) >= true === true'); +} + +//CHECK#7 +if (new Boolean(true) >= new Number(1) !== true) { + $ERROR('#7: new Boolean(true) >= new Number(1) === true'); +} + +//CHECK#8 +if (new Number(1) >= new Boolean(true) !== true) { + $ERROR('#8: new Number(1) >= new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.2.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.2.js new file mode 100644 index 000000000..3e4bca79b --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.2.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.2.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and String (primitive and object) + */ + +//CHECK#1 +if ("1" >= 1 !== true) { + $ERROR('#1: "1" >= 1 === true'); +} + +//CHECK#2 +if (1 >= "1" !== true) { + $ERROR('#2: 1 >= "1" === true'); +} + +//CHECK#3 +if (new String("1") >= 1 !== true) { + $ERROR('#3: new String("1") >= 1 === true'); +} + +//CHECK#4 +if (1 >= new String("1") !== true) { + $ERROR('#4: 1 >= new String("1") === true'); +} + +//CHECK#5 +if ("1" >= new Number(1) !== true) { + $ERROR('#5: "1" >= new Number(1) === true'); +} + +//CHECK#6 +if (new Number(1) >= "1" !== true) { + $ERROR('#6: new Number(1) >= "1" === true'); +} + +//CHECK#7 +if (new String("1") >= new Number(1) !== true) { + $ERROR('#7: new String("1") >= new Number(1) === true'); +} + +//CHECK#8 +if (new Number(1) >= new String("1") !== true) { + $ERROR('#8: new Number(1) >= new String("1") === true'); +} + +//CHECK#9 +if ("x" >= 1 !== false) { + $ERROR('#9: "x" >= 1 === false'); +} + +//CHECK#10 +if (1 >= "x" !== false) { + $ERROR('#10: 1 >= "x" === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.3.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.3.js new file mode 100644 index 000000000..4d0c6b6a9 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.3.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.3.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Null + */ + +//CHECK#1 +if (1 >= null !== true) { + $ERROR('#1: 1 >= null === true'); +} + +//CHECK#2 +if (null >= 1 !== false) { + $ERROR('#2: null >= 1 === false'); +} + +//CHECK#3 +if (new Number(1) >= null !== true) { + $ERROR('#3: new Number(1) >= null === true'); +} + +//CHECK#4 +if (null >= new Number(1) !== false) { + $ERROR('#4: null >= new Number(1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.4.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.4.js new file mode 100644 index 000000000..f94a78e5a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.4.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.4.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Number (primitive or object) and Undefined + */ + +//CHECK#1 +if (1 >= undefined !== false) { + $ERROR('#1: 1 >= undefined === false'); +} + +//CHECK#2 +if (undefined >= 1 !== false) { + $ERROR('#2: undefined >= 1 === false'); +} + +//CHECK#3 +if (new Number(1) >= undefined !== false) { + $ERROR('#3: new Number(1) >= undefined === false'); +} + +//CHECK#4 +if (undefined >= new Number(1) !== false) { + $ERROR('#4: undefined >= new Number(1) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.5.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.5.js new file mode 100644 index 000000000..5f949872e --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.5.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 Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.5.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Boolean (primitive and object) + */ + +//CHECK#1 +if (true >= "1" !== true) { + $ERROR('#1: true >= "1" === true'); +} + +//CHECK#2 +if ("1" >= true !== true) { + $ERROR('#2: "1" >= true === true'); +} + +//CHECK#3 +if (new Boolean(true) >= "1" !== true) { + $ERROR('#3: new Boolean(true) >= "1" === true'); +} + +//CHECK#4 +if ("1" >= new Boolean(true) !== true) { + $ERROR('#4: "1" >= new Boolean(true) === true'); +} + +//CHECK#5 +if (true >= new String("1") !== true) { + $ERROR('#5: true >= new String("1") === true'); +} + +//CHECK#6 +if (new String("1") >= true !== true) { + $ERROR('#6: new String("1") >= true === true'); +} + +//CHECK#7 +if (new Boolean(true) >= new String("1") !== true) { + $ERROR('#7: new Boolean(true) >= new String("1") === true'); +} + +//CHECK#8 +if (new String("1") >= new Boolean(true) !== true) { + $ERROR('#8: new String("1") >= new Boolean(true) === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.6.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.6.js new file mode 100644 index 000000000..ff2ab1820 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.6.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.6.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Undefined + */ + +//CHECK#1 +if ("1" >= undefined !== false) { + $ERROR('#1: "1" >= undefined === false'); +} + +//CHECK#2 +if (undefined >= "1" !== false) { + $ERROR('#2: undefined >= "1" === false'); +} + +//CHECK#3 +if (new String("1") >= undefined !== false) { + $ERROR('#3: new String("1") >= undefined === false'); +} + +//CHECK#4 +if (undefined >= new String("1") !== false) { + $ERROR('#4: undefined >= new String("1") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.7.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.7.js new file mode 100644 index 000000000..10745f98a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.7.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.7.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between String (primitive or object) and Null + */ + +//CHECK#1 +if ("1" >= null !== true) { + $ERROR('#1: "1" >= null === true'); +} + +//CHECK#2 +if (null >= "1" !== false) { + $ERROR('#2: null >= "1" === false'); +} + +//CHECK#3 +if (new String("1") >= null !== true) { + $ERROR('#3: new String("1") >= null === true'); +} + +//CHECK#4 +if (null >= new String("1") !== false) { + $ERROR('#4: null >= new String("1") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.8.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.8.js new file mode 100644 index 000000000..c45874ca8 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.8.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.8.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Undefined + */ + +//CHECK#1 +if (true >= undefined !== false) { + $ERROR('#1: true >= undefined === false'); +} + +//CHECK#2 +if (undefined >= true !== false) { + $ERROR('#2: undefined >= true === false'); +} + +//CHECK#3 +if (new Boolean(true) >= undefined !== false) { + $ERROR('#3: new Boolean(true) >= undefined === false'); +} + +//CHECK#4 +if (undefined >= new Boolean(true) !== false) { + $ERROR('#4: undefined >= new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.9.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.9.js new file mode 100644 index 000000000..8046d5a59 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.1_T2.9.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. + +/** + * If Type(Primitive(x)) is not String or Type(Primitive(y)) is not String, then operator x >= y returns ToNumber(x) >= ToNumber(y) + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.1_T2.9.js + * @description Type(Primitive(x)) is different from Type(Primitive(y)) and both types vary between Boolean (primitive or object) and Null + */ + +//CHECK#1 +if (true >= null !== true) { + $ERROR('#1: true >= null === true'); +} + +//CHECK#2 +if (null >= true !== false) { + $ERROR('#2: null >= true === false'); +} + +//CHECK#3 +if (new Boolean(true) >= null !== true) { + $ERROR('#3: new Boolean(true) >= null === true'); +} + +//CHECK#4 +if (null >= new Boolean(true) !== false) { + $ERROR('#4: null >= new Boolean(true) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.2_T1.1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.2_T1.1.js new file mode 100644 index 000000000..d166d3f9b --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.2_T1.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. + +/** + * Operator x >= y returns ToString(x) >= ToString(y), if Type(Primitive(x)) is String and Type(Primitive(y)) is String + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.2_T1.1.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between primitive string and String object + */ + +//CHECK#1 +if ("1" >= "1" !== true) { + $ERROR('#1: "1" >= "1" === true'); +} + +//CHECK#2 +if (new String("1") >= "1" !== true) { + $ERROR('#2: new String("1") >= "1" === true'); +} + +//CHECK#3 +if ("1" >= new String("1") !== true) { + $ERROR('#3: "1" >= new String("1") === true'); +} + +//CHECK#4 +if (new String("1") >= new String("1") !== true) { + $ERROR('#4: new String("1") >= new String("1") === true'); +} + +//CHECK#5 +if ("x" >= "1" !== true) { + $ERROR('#5: "x" >= "1" === true'); +} + +//CHECK#6 +if ("1" >= "x" !== false) { + $ERROR('#6: "1" >= "x" === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.2_T1.2.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.2_T1.2.js new file mode 100644 index 000000000..7a981028c --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A3.2_T1.2.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. + +/** + * Operator x >= y returns ToString(x) >= ToString(y), if Type(Primitive(x)) is String and Type(Primitive(y)) is String + * + * @path ch11/11.8/11.8.4/S11.8.4_A3.2_T1.2.js + * @description Type(Primitive(x)) and Type(Primitive(y)) vary between Object object and Function object + */ + +//CHECK#1 +if (({} >= function(){return 1}) !== ({}.toString() >= function(){return 1}.toString())) { + $ERROR('#1: ({} >= function(){return 1}) === ({}.toString() >= function(){return 1}.toString())'); +} + +//CHECK#2 +if ((function(){return 1} >= {}) !== (function(){return 1}.toString() >= {}.toString())) { + $ERROR('#2: (function(){return 1} >= {}) === (function(){return 1}.toString() >= {}.toString())'); +} + +//CHECK#3 +if ((function(){return 1} >= function(){return 1}) !== (function(){return 1}.toString() >= function(){return 1}.toString())) { + $ERROR('#3: (function(){return 1} >= function(){return 1}) === (function(){return 1}.toString() >= function(){return 1}.toString())'); +} + +//CHECK#4 +if (({} >= {}) !== ({}.toString() >= {}.toString())) { + $ERROR('#4: ({} >= {}) === ({}.toString() >= {}.toString())'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.1.js new file mode 100644 index 000000000..601f23715 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.1.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.1.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NaN >= 0) !== false) { + $ERROR('#1: (NaN >= 0) === false'); +} + +//CHECK#2 +if ((Number.NaN >= 1.1) !== false) { + $ERROR('#2: (NaN >= 1.1) === false'); +} + +//CHECK#3 +if ((Number.NaN >= -1.1) !== false) { + $ERROR('#3: (NaN >= -1.1) === false'); +} + +//CHECK#4 +if ((Number.NaN >= Number.NaN) !== false) { + $ERROR('#4: (NaN >= NaN) === false'); +} + +//CHECK#5 +if ((Number.NaN >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (NaN >= +Infinity) === false'); +} + +//CHECK#6 +if ((Number.NaN >= Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#6: (NaN >= -Infinity) === false'); +} + +//CHECK#7 +if ((Number.NaN >= Number.MAX_VALUE) !== false) { + $ERROR('#7: (NaN >= Number.MAX_VALUE) === false'); +} + +//CHECK#8 +if ((Number.NaN >= Number.MIN_VALUE) !== false) { + $ERROR('#8: (NaN >= Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.10.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.10.js new file mode 100644 index 000000000..caaf1fa86 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.10.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is a prefix of y and x !== y, return false + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.10.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" >= "x ") !== false) { + $ERROR('#1: ("x" >= "x ") === false'); +} + +//CHECK#2 +if (("" >= "x") !== false) { + $ERROR('#2: ("" >= "x") === false'); +} + +//CHECK#3 +if (("ab" >= "abcd") !== false) { + $ERROR('#3: ("ab" >= abcd") === false'); +} + +//CHECK#4 +if (("abcd" >= "abc\u0064") !== true) { + $ERROR('#4: ("abcd" >= abc\\u0064") === true'); +} + +//CHECK#5 +if (("x" >= "x" + "y") !== false) { + $ERROR('#5: ("x" >= "x" + "y") === false'); +} + +//CHECK#6 +var x = "x"; +if ((x >= x + "y") !== false) { + $ERROR('#6: var x = "x"; (x >= x + "y") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.11.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.11.js new file mode 100644 index 000000000..98b792a6d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.11.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is a prefix of x, return true + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.11.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" >= "x") !== true) { + $ERROR('#1: ("x" >= "x") === true'); +} + +//CHECK#2 +if (("x" >= "") !== true) { + $ERROR('#2: ("x" >= "") === true'); +} + +//CHECK#3 +if (("abcd" >= "ab") !== true) { + $ERROR('#3: ("abcd" >= ab") === true'); +} + +//CHECK#4 +if (("abc\u0064" >= "abcd") !== true) { + $ERROR('#4: ("abc\\u0064" >= abc") === true'); +} + +//CHECK#5 +if (("x" + "y" >= "x") !== true) { + $ERROR('#5: ("x" + "y" >= "x") === true'); +} + +//CHECK#6 +var x = "x"; +if ((x + 'y' >= x) !== true) { + $ERROR('#6: var x = "x"; (x + "y" >= x) === true'); +} + +//CHECK#7 +if (("a\u0000a" >= "a\u0000") !== true) { + $ERROR('#7: ("a\\u0000a" >= "a\\u0000") === true'); +} + +//CHECK#8 +if ((" x" >= "x") !== false) { + $ERROR('#8: (" x" >= "x") === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.12_T1.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.12_T1.js new file mode 100644 index 000000000..961dc236f --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.12_T1.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.12_T1.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("xy" >= "xx") !== true) { + $ERROR('#1: ("xy" >= "xx") === true'); +} + +//CHECK#2 +if (("xx" >= "xy") !== false) { + $ERROR('#2: ("xx" >= "xy") === false'); +} + +//CHECK#3 +if (("y" >= "x") !== true) { + $ERROR('#3: ("y" >= "x") === true'); +} + +//CHECK#4 +if (("aba" >= "aab") !== true) { + $ERROR('#4: ("aba" >= aab") === true'); +} + +//CHECK#5 +if (("\u0061\u0061\u0061\u0061" >= "\u0061\u0061\u0061\u0062") !== false) { + $ERROR('#5: ("\\u0061\\u0061\\u0061\\u0061" >= \\u0061\\u0061\\u0061\\u0062") === false'); +} + +//CHECK#6 +if (("a\u0000b" >= "a\u0000a") !== true) { + $ERROR('#6: ("a\\u0000b" >= "a\\u0000a") === true'); +} + +//CHECK#7 +if (("aa" >= "aB") !== true) { + $ERROR('#7: ("aa" >= aB") === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.12_T2.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.12_T2.js new file mode 100644 index 000000000..851e69d49 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.12_T2.js @@ -0,0 +1,45 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If neither x, nor y is a prefix of each other, returned result of strings comparison applies a simple lexicographic ordering to the sequences of code point value values + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.12_T2.js + * @description x and y are string primitives + */ + +//CHECK#1 +if (("x" >= "0") !== true) { + $ERROR('#1: ("x" >= "0") !== true'); +} + +//CHECK#2 +if (("0" >= "-") !== true) { + $ERROR('#2: ("0" >= "-") !== true'); +} + +//CHECK#3 +if (("0" >= ".") !== true) { + $ERROR('#3: ("0" >= ".") !== true'); +} + +//CHECK#4 +if (("-" >= "+") !== true) { + $ERROR('#4: ("-" >= "+") !== true'); +} + +//CHECK#5 +if (("-1" >= "-0") !== true) { + $ERROR('#5: ("-1" >= "-0") !== true'); +} + +//CHECK#6 +if (("-1" >= "+1") !== true) { + $ERROR('#6: ("-1" >= "+1") !== true'); +} + +//CHECK#7 +if (("1e-10" >= "1") !== true) { +$ERROR('#7: ("1e-10" >= "1") !== true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.2.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.2.js new file mode 100644 index 000000000..a10b2ab4e --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.2.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is NaN, return false (if result in 11.8.5 is undefined, return false) + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.2.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 >= Number.NaN) !== false) { + $ERROR('#1: (0 >= NaN) === false'); +} + +//CHECK#2 +if ((1.1 >= Number.NaN) !== false) { + $ERROR('#2: (1.1 >= NaN) === false'); +} + +//CHECK#3 +if ((-1.1 >= Number.NaN) !== false) { + $ERROR('#3: (-1.1 >= NaN) === false'); +} + +//CHECK#4 +if ((Number.NaN >= Number.NaN) !== false) { + $ERROR('#4: (NaN >= NaN) === false'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY >= Number.NaN) !== false) { + $ERROR('#5: (+Infinity >= NaN) === false'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY >= Number.NaN) !== false) { + $ERROR('#6: (-Infinity >= NaN) === false'); +} + +//CHECK#7 +if ((Number.MAX_VALUE >= Number.NaN) !== false) { + $ERROR('#7: (Number.MAX_VALUE >= NaN) === false'); +} + +//CHECK#8 +if ((Number.MIN_VALUE >= Number.NaN) !== false) { + $ERROR('#8: (Number.MIN_VALUE >= NaN) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.3.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.3.js new file mode 100644 index 000000000..4169a91bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.3.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x and y are the same number value, return true + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.3.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1 >= 1) !== true) { + $ERROR('#1: (1 >= 1) === true'); +} + +//CHECK#2 +if ((1.1 >= 1.1) !== true) { + $ERROR('#2: (1.1 >= 1.1) === true'); +} + +//CHECK#3 +if ((-1.1 >= -1.1) !== true) { + $ERROR('#3: (-1.1 >= -1.1) === true'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#4: (-Infinity >= -Infinity) === true'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY >= Number.POSITIVE_INFINITY) !== true) { + $ERROR('#5: (+Infinity >= +Infinity) === true'); +} + +//CHECK#6 +if ((Number.MAX_VALUE >= Number.MAX_VALUE) !== true) { + $ERROR('#6: (Number.MAX_VALUE >= Number.MAX_VALUE) === true'); +} + +//CHECK#7 +if ((Number.MIN_VALUE >= Number.MIN_VALUE) !== true) { + $ERROR('#7: (Number.MIN_VALUE >= Number.MIN_VALUE) === true'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.4.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.4.js new file mode 100644 index 000000000..3abe7fa77 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.4.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 either x or y is +0 and the other is -0, return true + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.4.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'); +} + +//CHECK#3 +if ((+0 >= -0) !== true) { + $ERROR('#3: (+0 >= -0) === true'); +} + +//CHECK#4 +if ((-0 >= +0) !== true) { + $ERROR('#4: (-0 >= +0) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.5.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.5.js new file mode 100644 index 000000000..e0357fee2 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.5.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is +Infinity, return true + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.5.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.POSITIVE_INFINITY >= 0) !== true) { + $ERROR('#1: (+Infinity >= 0) === true'); +} + +//CHECK#2 +if ((Number.POSITIVE_INFINITY >= 1.1) !== true) { + $ERROR('#2: (+Infinity >= 1.1) === true'); +} + +//CHECK#3 +if ((Number.POSITIVE_INFINITY >= -1.1) !== true) { + $ERROR('#3: (+Infinity >= -1.1) === true'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#4: (+Infinity >= -Infinity) === true'); +} + +//CHECK#5 +if ((Number.POSITIVE_INFINITY >= Number.MAX_VALUE) !== true) { + $ERROR('#5: (+Infinity >= Number.MAX_VALUE) === true'); +} + +//CHECK#6 +if ((Number.POSITIVE_INFINITY >= Number.MIN_VALUE) !== true) { + $ERROR('#6: (+Infinity >= Number.MIN_VALUE) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.6.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.6.js new file mode 100644 index 000000000..b1f898a14 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.6.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is +Infinity and x !== y, return false + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.6.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#1: (0 >= +Infinity) === false'); +} + +//CHECK#2 +if ((1.1 >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#2: (1.1 >= +Infinity) === false'); +} + +//CHECK#3 +if ((-1.1 >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#3: (-1.1 >= +Infinity) === false'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#4: (-Infinity >= +Infinity) === false'); +} + +//CHECK#5 +if ((Number.MAX_VALUE >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#5: (Number.MAX_VALUE >= +Infinity) === false'); +} + +//CHECK#6 +if ((Number.MIN_VALUE >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#6: (Number.MIN_VALUE >= +Infinity) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.7.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.7.js new file mode 100644 index 000000000..6a423b834 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.7.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is -Infinity and x !== y, return false + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.7.js + * @description y is number primitive + */ + +//CHECK#1 +if ((Number.NEGATIVE_INFINITY >= 0) !== false) { + $ERROR('#1: (-Infinity >= 0) === false'); +} + +//CHECK#2 +if ((Number.NEGATIVE_INFINITY >= 1.1) !== false) { + $ERROR('#2: (-Infinity >= 1.1) === false'); +} + +//CHECK#3 +if ((Number.NEGATIVE_INFINITY >= -1.1) !== false) { + $ERROR('#3: (-Infinity >= -1.1) === false'); +} + +//CHECK#4 +if ((Number.NEGATIVE_INFINITY >= Number.POSITIVE_INFINITY) !== false) { + $ERROR('#4: (-Infinity >= +Infinity) === false'); +} + +//CHECK#5 +if ((Number.NEGATIVE_INFINITY >= Number.MAX_VALUE) !== false) { + $ERROR('#5: (-Infinity >= Number.MAX_VALUE) === false'); +} + +//CHECK#6 +if ((Number.NEGATIVE_INFINITY >= Number.MIN_VALUE) !== false) { + $ERROR('#6: (-Infinity >= Number.MIN_VALUE) === false'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.8.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.8.js new file mode 100644 index 000000000..ce00360b3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.8.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If y is -Infinity, return true + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.8.js + * @description x is number primitive + */ + +//CHECK#1 +if ((0 >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#1: (0 >= -Infinity) === true'); +} + +//CHECK#2 +if ((1.1 >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#2: (1.1 >= -Infinity) === true'); +} + +//CHECK#3 +if ((-1.1 >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#3: (-1.1 >= -Infinity) === true'); +} + +//CHECK#4 +if ((Number.POSITIVE_INFINITY >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#4: (+Infinity >= -Infinity) === true'); +} + +//CHECK#5 +if ((Number.MAX_VALUE >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#5: (Number.MAX_VALUE >= -Infinity) === true'); +} + +//CHECK#6 +if ((Number.MIN_VALUE >= Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#6: (Number.MIN_VALUE >= -Infinity) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.9.js b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.9.js new file mode 100644 index 000000000..116d934ef --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/S11.8.4_A4.9.js @@ -0,0 +1,52 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * If x is greater or equal than y and these values are both finite non-zero, return true; otherwise, return false + * + * @path ch11/11.8/11.8.4/S11.8.4_A4.9.js + * @description x and y are number primitives + */ + +//CHECK#1 +if ((1 >= 1.1) !== false) { + $ERROR('#1: (1 >= 1.1) === false'); +} + +//CHECK#2 +if ((1.1 >= 1) !== true) { + $ERROR('#2: (1.1 >= 1) === true'); +} + +//CHECK#3 +if ((-1 >= -1.1) !== true) { + $ERROR('#3: (-1 >= -1.1) === true'); +} + +//CHECK#4 +if ((-1.1 >= -1) !== false) { + $ERROR('#4: (-1.1 >= -1) === false'); +} + +//CHECK#5 +if ((0.1 >= 0) !== true) { + $ERROR('#5: (0.1 >= 0) === true'); +} + +//CHECK#6 +if ((0 >= -0.1) !== true) { + $ERROR('#6: (0 >= -0.1) === true'); +} + +//CHECK#7 +if ((Number.MAX_VALUE >= Number.MAX_VALUE/2) !== true) { + $ERROR('#7: (Number.MAX_VALUE >= Number.MAX_VALUE/2) === true'); +} + +//CHECK#8 +if ((Number.MIN_VALUE*2 >= Number.MIN_VALUE) !== true) { + $ERROR('#8: (Number.MIN_VALUE*2 >= Number.MIN_VALUE) === true'); +} + + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/browser.js b/js/src/tests/test262/ch11/11.8/11.8.4/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/browser.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.4/shell.js b/js/src/tests/test262/ch11/11.8/11.8.4/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.4/shell.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A1.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A1.js new file mode 100644 index 000000000..282b9fda4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_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 RelationalExpression and "instanceof" and between "instanceof" and ShiftExpression are allowed + * + * @path ch11/11.8/11.8.6/S11.8.6_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("({})\u0009instanceof\u0009Object") !== true) { + $ERROR('#1: ({})\\u0009instanceof\\u0009Object === true'); +} + +//CHECK#2 +if (eval("({})\u000Binstanceof\u000BObject") !== true) { + $ERROR('#2: ({})\\u000Binstanceof\\u000BObject === true'); +} + +//CHECK#3 +if (eval("({})\u000Cinstanceof\u000CObject") !== true) { + $ERROR('#3: ({})\\u000Cinstanceof\\u000CObject === true'); +} + +//CHECK#4 +if (eval("({})\u0020instanceof\u0020Object") !== true) { + $ERROR('#4: ({})\\u0020instanceof\\u0020Object === true'); +} + +//CHECK#5 +if (eval("({})\u00A0instanceof\u00A0Object") !== true) { + $ERROR('#5: ({})\\u00A0instanceof\\u00A0Object === true'); +} + +//CHECK#6 +if (eval("({})\u000Ainstanceof\u000AObject") !== true) { + $ERROR('#6: ({})\\u000Ainstanceof\\u000AObject === true'); +} + +//CHECK#7 +if (eval("({})\u000Dinstanceof\u000DObject") !== true) { + $ERROR('#7: ({})\\u000Dinstanceof\\u000DObject === true'); +} + +//CHECK#8 +if (eval("({})\u2028instanceof\u2028Object") !== true) { + $ERROR('#8: ({})\\u2028instanceof\\u2028Object === true'); +} + +//CHECK#9 +if (eval("({})\u2029instanceof\u2029Object") !== true) { + $ERROR('#9: ({})\\u2029instanceof\\u2029Object === true'); +} + +//CHECK#10 +if (eval("({})\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029instanceof\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029Object") !== true) { + $ERROR('#10: ({})\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029instanceof\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029Object === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T1.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T1.js new file mode 100644 index 000000000..e7a31658c --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator "instanceof" uses GetValue + * + * @path ch11/11.8/11.8.6/S11.8.6_A2.1_T1.js + * @description Either Expression is not Reference or GetBase is not null + */ + +//CHECK#1 +if (({}) instanceof Object !== true) { + $ERROR('#1: ({}) instanceof Object === true'); +} + +//CHECK#2 +var object = {}; +if (object instanceof Object !== true) { + $ERROR('#2: var object = {}; object instanceof Object === true'); +} + +//CHECK#3 +var OBJECT = Object; +if (({}) instanceof OBJECT !== true) { + $ERROR('#3: var OBJECT = Object; ({}) instanceof OBJECT === true'); +} + +//CHECK#4 +var object = {}; +var OBJECT = Object; +if (object instanceof OBJECT !== true) { + $ERROR('#4: var object = {}; var OBJECT = Object; object instanceof OBJECT === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T2.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T2.js new file mode 100644 index 000000000..9477b0b5d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator "instanceof" uses GetValue + * + * @path ch11/11.8/11.8.6/S11.8.6_A2.1_T2.js + * @description If GetBase(RelationalExpression) is null, throw ReferenceError + */ + +//CHECK#1 +try { + object instanceof Object; + $ERROR('#1.1: object instanceof Object throw ReferenceError. Actual: ' + (object instanceof Object)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: object instanceof Object throw ReferenceError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T3.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T3.js new file mode 100644 index 000000000..bb0a094ce --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.1_T3.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator "instanceof" uses GetValue + * + * @path ch11/11.8/11.8.6/S11.8.6_A2.1_T3.js + * @description If GetBase(ShiftExpression) is null, throw ReferenceError + */ + +//CHECK#1 +try { + ({}) instanceof OBJECT; + $ERROR('#1.1: ({}) instanceof OBJECT throw ReferenceError. Actual: ' + (({}) instanceof OBJECT)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: ({}) instanceof OBJECT throw ReferenceError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.4_T1.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.4_T1.js new file mode 100644 index 000000000..957c99b3b --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_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.8/11.8.6/S11.8.6_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var OBJECT = 0; +if ((OBJECT = Object, {}) instanceof OBJECT !== true) { + $ERROR('#1: var OBJECT = 0; (OBJECT = Object, {}) instanceof OBJECT === true'); +} + +//CHECK#2 +var object = {}; +if (object instanceof (object = 0, Object) !== true) { + $ERROR('#2: var object = {}; object instanceof (object = 0, Object) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.4_T2.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.4_T2.js new file mode 100644 index 000000000..5f87c4342 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_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.8/11.8.6/S11.8.6_A2.4_T2.js + * @description Checking with "throw" + */ + +//CHECK#1 +var x = function () { throw "x"; }; +var y = function () { throw "y"; }; +try { + x() instanceof y(); + $ERROR('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() instanceof y() throw "x". Actual: ' + (x() instanceof 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() instanceof y() throw "x". Actual: ' + (e)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.4_T3.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A2.4_T3.js new file mode 100644 index 000000000..06ef16073 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_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.8/11.8.6/S11.8.6_A2.4_T3.js + * @description Checking with undeclarated variables + */ + +//CHECK#1 +try { + object instanceof (object = {}, Object); + $ERROR('#1.1: object instanceof (object = {}, Object) throw ReferenceError. Actual: ' + (object instanceof (object = {}, Object))); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: object instanceof (object = {}, Object) throw ReferenceError. Actual: ' + (e)); + } +} + +//CHECK#2 +if ((OBJECT = Object, {}) instanceof OBJECT !== true) { + $ERROR('#2: (OBJECT = Object, {}) instanceof OBJECT !== true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A3.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A3.js new file mode 100644 index 000000000..da3d7e5dc --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A3.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 ShiftExpression is not an object, throw TypeError + * + * @path ch11/11.8/11.8.6/S11.8.6_A3.js + * @description Checking all the types of primitives + */ + +//CHECK#1 +try { + true instanceof true; + $ERROR('#1: true instanceof true throw TypeError'); +} +catch (e) { + if (e instanceof TypeError !== true) { + $ERROR('#1: true instanceof true throw TypeError'); + } +} + +//CHECK#2 +try { + 1 instanceof 1; + $ERROR('#2: 1 instanceof 1 throw TypeError'); +} +catch (e) { + if (e instanceof TypeError !== true) { + $ERROR('#2: 1 instanceof 1 throw TypeError'); + } +} + +//CHECK#3 +try { + "string" instanceof "string"; + $ERROR('#3: "string" instanceof "string" throw TypeError'); +} +catch (e) { + if (e instanceof TypeError !== true) { + $ERROR('#3: "string" instanceof "string" throw TypeError'); + } +} + +//CHECK#4 +try { + undefined instanceof undefined; + $ERROR('#4: undefined instanceof undefined throw TypeError'); +} +catch (e) { + if (e instanceof TypeError !== true) { + $ERROR('#4: undefined instanceof undefined throw TypeError'); + } +} + +//CHECK#5 +try { + null instanceof null; + $ERROR('#5: null instanceof null throw TypeError'); +} +catch (e) { + if (e instanceof TypeError !== true) { + $ERROR('#5: null instanceof null throw TypeError'); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T1.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T1.js new file mode 100644 index 000000000..0f9d2319d --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T1.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. + +/** + * Only constructor call (with "new" keyword) makes instance + * + * @path ch11/11.8/11.8.6/S11.8.6_A4_T1.js + * @description Checking Boolean case + */ + +//CHECK#1 +if (false instanceof Boolean) { + $ERROR('#1: false is not instanceof Boolean'); +} + +//CHECK#2 +if (Boolean(false) instanceof Boolean) { + $ERROR('#2: Boolean(false) is not instanceof Boolean'); +} + +//CHECK#3 +if (new Boolean instanceof Boolean !== true) { + $ERROR('#3: new Boolean instanceof Boolean'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T2.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T2.js new file mode 100644 index 000000000..a4f1f3c02 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_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. + +/** + * Only constructor call (with "new" keyword) makes instance + * + * @path ch11/11.8/11.8.6/S11.8.6_A4_T2.js + * @description Checking Number case + */ + +//CHECK#1 +if (0 instanceof Number) { + $ERROR('#1: 0 is not instanceof Number'); +} + +//CHECK#2 +if (Number(0) instanceof Number) { + $ERROR('#2: Number(0) is not instanceof Number'); +} + +//CHECK#3 +if (new Number instanceof Number !== true) { + $ERROR('#3: new Number instanceof Number'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T3.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T3.js new file mode 100644 index 000000000..c8220049c --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A4_T3.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. + +/** + * Only constructor call (with "new" keyword) makes instance + * + * @path ch11/11.8/11.8.6/S11.8.6_A4_T3.js + * @description Checking String case + */ + +//CHECK#1 +if ("" instanceof String) { + $ERROR('#1: "" is not instanceof String'); +} + +//CHECK#2 +if (String("") instanceof String) { + $ERROR('#2: String("") is not instanceof String'); +} + +//CHECK#3 +if (new String instanceof String !== true) { + $ERROR('#3: new String instanceof String'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A5_T1.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A5_T1.js new file mode 100644 index 000000000..66d61034c --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A5_T1.js @@ -0,0 +1,47 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * TypeError is subclass of Error from instanceof operator point of view + * + * @path ch11/11.8/11.8.6/S11.8.6_A5_T1.js + * @description Checking Error case + */ + +var __err = new Error; + +////////////////////////////////////////////////////////////////////////////// +//CHECK#1 +if (!(__err instanceof Error)) { + $ERROR('#1: TypeError is subclass of Error from instanceof operator poit of view'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#2 +if (__err instanceof TypeError) { + $ERROR('#2: TypeError is subclass of Error from instanceof operator poit of view'); +} +// +////////////////////////////////////////////////////////////////////////////// + +var err__ = Error('failed'); + +////////////////////////////////////////////////////////////////////////////// +//CHECK#3 +if (!(err__ instanceof Error)) { + $ERROR('#3: TypeError is subclass of Error from instanceof operator poit of view'); +} +// +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +//CHECK#4 +if (err__ instanceof TypeError) { + $ERROR('#4: TypeError is subclass of Error from instanceof operator poit of view'); +} +// +////////////////////////////////////////////////////////////////////////////// + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A5_T2.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A5_T2.js new file mode 100644 index 000000000..340f09ff4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A5_T2.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. + +/** + * TypeError is subclass of Error from instanceof operator point of view + * + * @path ch11/11.8/11.8.6/S11.8.6_A5_T2.js + * @description Checking TypeError case + */ + +var __t__err = new TypeError; + +//CHECK#1 +if (!(__t__err instanceof Error)) { + $ERROR('#1: TypeError is subclass of Error from instanceof operator poit of view'); +} + +//CHECK#2 +if (!(__t__err instanceof TypeError)) { + $ERROR('#2: TypeError is subclass of Error from instanceof operator poit of view'); +} + +////////////////////////////////////////////////////////////////////////////// +var err__t__ = TypeError('failed'); + +//CHECK#3 +if (!(err__t__ instanceof Error)) { + $ERROR('#3: TypeError is subclass of Error from instanceof operator poit of view'); +} + +//CHECK#4 +if (!(err__t__ instanceof TypeError)) { + $ERROR('#4: TypeError is subclass of Error from instanceof operator poit of view'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T1.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T1.js new file mode 100644 index 000000000..16e0d82b3 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T1.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. + +/** + * Only Function objects implement [[HasInstance]] and can be proper ShiftExpression for the "instanceof" operator consequently + * + * @path ch11/11.8/11.8.6/S11.8.6_A6_T1.js + * @description Checking "this" case + */ + +//CHECK#1 +try{ + ({}) instanceof this; + $ERROR('#1: Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator'); +} +catch(e){ + if (e instanceof TypeError !== true) { + $ERROR('#1: Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator'); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T2.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T2.js new file mode 100644 index 000000000..f25dbed82 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Only Function objects implement [[HasInstance]] and can be proper ShiftExpression for the "instanceof" operator consequently + * + * @path ch11/11.8/11.8.6/S11.8.6_A6_T2.js + * @description Checking Math case + */ + +//CHECK#1 +try{ + 1 instanceof Math; + $ERROR('#1: 1 instanceof Math throw TypeError'); +} +catch(e){ + if (e instanceof TypeError !== true) { + $ERROR('#1: 1 instanceof Math throw TypeError'); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T3.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T3.js new file mode 100644 index 000000000..24773ad97 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_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. + +/** + * Only Function objects implement [[HasInstance]] and can be proper ShiftExpression for the "instanceof" operator consequently + * + * @path ch11/11.8/11.8.6/S11.8.6_A6_T3.js + * @description Checking if RelationalExpression is function + */ + +function MyFunct(){return 0}; + +//CHECK#1 +if (MyFunct instanceof MyFunct){ + $ERROR('#1 function MyFunct(){return 0}; MyFunct instanceof MyFunct === false'); +} + +//CHECK#2 +if (MyFunct instanceof Function !== true){ + $ERROR('#2 function MyFunct(){return 0}; MyFunct instanceof Function === true'); +} + +//CHECK#3 +if (MyFunct instanceof Object !== true){ + $ERROR('#3 function MyFunct(){return 0}; MyFunct instanceof Object === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T4.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T4.js new file mode 100644 index 000000000..68aa843e8 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A6_T4.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. + +/** + * Only Function objects implement [[HasInstance]] and can be proper ShiftExpression for the "instanceof" operator consequently + * + * @path ch11/11.8/11.8.6/S11.8.6_A6_T4.js + * @description Checking if RelationalExpression is object + */ + +MyFunct = function(){}; +__my__funct = new MyFunct; + + +//CHECK#1 +if (!(__my__funct instanceof MyFunct)){ + $ERROR('#1 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator'); +} + +//CHECK#2 +if (__my__funct instanceof Function){ + $ERROR('#2 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator'); +} + +//CHECK#3 +if (!(__my__funct instanceof Object)){ + $ERROR('#3 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator'); +} + +//CHECK#4 +try{ + __my__funct instanceof __my__funct; + $ERROR('#4 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator'); +} +catch(e){ + if (e instanceof TypeError !== true) { + $ERROR('#4 Only Function objects implement [[HasInstance]] and consequently can be proper ShiftExpression for The instanceof operator'); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T1.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T1.js new file mode 100644 index 000000000..97944a5fd --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T1.js @@ -0,0 +1,22 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * When "instanceof" returns true it means that GetValue(RelationalExpression) is constructed with ShiftExpression + * + * @path ch11/11.8/11.8.6/S11.8.6_A7_T1.js + * @description Checking Object object + */ + +var __obj={}; + +//CHECK#1 +if (!(__obj instanceof Object)) { + $ERROR('#1: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression'); +} + +//CHECK#2 +if (__obj.constructor !== Object) { + $ERROR('#2: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T2.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T2.js new file mode 100644 index 000000000..c77c93c18 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_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. + +/** + * When "instanceof" returns true it means that GetValue(RelationalExpression) is constructed with ShiftExpression + * + * @path ch11/11.8/11.8.6/S11.8.6_A7_T2.js + * @description Checking Array object + */ + +var __arr=[]; + +//CHECK#1 +if (!(__arr instanceof Array)) { + $ERROR('#1: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression'); +} + +//CHECK#2 +if (__arr.constructor !== Array) { + $ERROR('#2: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T3.js b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T3.js new file mode 100644 index 000000000..8d476a8ad --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/S11.8.6_A7_T3.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. + +/** + * When "instanceof" returns true it means that GetValue(RelationalExpression) is constructed with ShiftExpression + * + * @path ch11/11.8/11.8.6/S11.8.6_A7_T3.js + * @description Checking Function object + */ + +var __func = new Function; + +//CHECK#1 +if (!(__func instanceof Function)) { + $ERROR('#1: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression'); +} + +//CHECK#2 +if (__func.constructor !== Function) { + $ERROR('#2: If instanceof returns true then GetValue(RelationalExpression) was constructed with ShiftExpression'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/browser.js b/js/src/tests/test262/ch11/11.8/11.8.6/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/browser.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.6/shell.js b/js/src/tests/test262/ch11/11.8/11.8.6/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.6/shell.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A1.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A1.js new file mode 100644 index 000000000..93c67bfcc --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_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 RelationalExpression and "in" and between "in" and ShiftExpression are allowed + * + * @path ch11/11.8/11.8.7/S11.8.7_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("'MAX_VALUE'\u0009in\u0009Number") !== true) { + $ERROR('#1: "MAX_VALUE"\\u0009in\\u0009Number === true'); +} + +//CHECK#2 +if (eval("'MAX_VALUE'\u000Bin\u000BNumber") !== true) { + $ERROR('#2: "MAX_VALUE"\\u000Bin\\u000BNumber === true'); +} + +//CHECK#3 +if (eval("'MAX_VALUE'\u000Cin\u000CNumber") !== true) { + $ERROR('#3: "MAX_VALUE"\\u000Cin\\u000CNumber === true'); +} + +//CHECK#4 +if (eval("'MAX_VALUE'\u0020in\u0020Number") !== true) { + $ERROR('#4: "MAX_VALUE"\\u0020in\\u0020Number === true'); +} + +//CHECK#5 +if (eval("'MAX_VALUE'\u00A0in\u00A0Number") !== true) { + $ERROR('#5: "MAX_VALUE"\\u00A0in\\u00A0Number === true'); +} + +//CHECK#6 +if (eval("'MAX_VALUE'\u000Ain\u000ANumber") !== true) { + $ERROR('#6: "MAX_VALUE"\\u000Ain\\u000ANumber === true'); +} + +//CHECK#7 +if (eval("'MAX_VALUE'\u000Din\u000DNumber") !== true) { + $ERROR('#7: "MAX_VALUE"\\u000Din\\u000DNumber === true'); +} + +//CHECK#8 +if (eval("'MAX_VALUE'\u2028in\u2028Number") !== true) { + $ERROR('#8: "MAX_VALUE"\\u2028in\\u2028Number === true'); +} + +//CHECK#9 +if (eval("'MAX_VALUE'\u2029in\u2029Number") !== true) { + $ERROR('#9: "MAX_VALUE"\\u2029in\\u2029Number === true'); +} + +//CHECK#10 +if (eval("'MAX_VALUE'\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029in\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029Number") !== true) { + $ERROR('#10: "MAX_VALUE"\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029in\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029Number === true'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T1.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T1.js new file mode 100644 index 000000000..0e33a3d02 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T1.js @@ -0,0 +1,35 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator "in" uses GetValue + * + * @path ch11/11.8/11.8.7/S11.8.7_A2.1_T1.js + * @description Either Expression is not Reference or GetBase is not null + */ + +//CHECK#1 +if ("MAX_VALUE" in Number !== true) { + $ERROR('#1: "MAX_VALUE" in Number === true'); +} + +//CHECK#2 +var x = "MAX_VALUE"; +if (x in Number !== true) { + $ERROR('#2: var x = "MAX_VALUE"; x in Number === true'); +} + +//CHECK#3 +var y = Number; +if ("MAX_VALUE" in y !== true) { + $ERROR('#3: var y = Number; "MAX_VALUE" in y === true'); +} + +//CHECK#4 +var x = "MAX_VALUE"; +var y = Number; +if (x in y !== true) { + $ERROR('#4: var x = "MAX_VALUE"; var y = Number; x in y === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T2.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T2.js new file mode 100644 index 000000000..307b23b83 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T2.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator "in" uses GetValue + * + * @path ch11/11.8/11.8.7/S11.8.7_A2.1_T2.js + * @description If GetBase(RelationalExpression) is null, throw ReferenceError + */ + +//CHECK#1 +try { + MAX_VALUE in Number; + $ERROR('#1.1: MAX_VALUE in Number throw ReferenceError. Actual: ' + (MAX_VALUE in Number)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: MAX_VALUE in Number throw ReferenceError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T3.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T3.js new file mode 100644 index 000000000..89f69661a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.1_T3.js @@ -0,0 +1,21 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator "in" uses GetValue + * + * @path ch11/11.8/11.8.7/S11.8.7_A2.1_T3.js + * @description If GetBase(ShiftExpression) is null, throw ReferenceError + */ + +//CHECK#1 +try { + "MAX_VALUE" in NUMBER; + $ERROR('#1.1: "MAX_VALUE" in NUMBER throw ReferenceError. Actual: ' + ("MAX_VALUE" in NUMBER)); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: "MAX_VALUE" in NUMBER throw ReferenceError. Actual: ' + (e)); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.4_T1.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.4_T1.js new file mode 100644 index 000000000..5403131ae --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_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.8/11.8.7/S11.8.7_A2.4_T1.js + * @description Checking with "=" + */ + +//CHECK#1 +var NUMBER = 0; +if ((NUMBER = Number, "MAX_VALUE") in NUMBER !== true) { + $ERROR('#1: var NUMBER = 0; (NUMBER = Number, "MAX_VALUE") in NUMBER === true'); +} + +//CHECK#2 +var max_value = "MAX_VALUE"; +if (max_value in (max_value = "none", Number) !== true) { + $ERROR('#2: var max_value = "MAX_VALUE"; max_value in (max_value = "none", Number) === true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.4_T2.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.4_T2.js new file mode 100644 index 000000000..3016c2278 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_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.8/11.8.7/S11.8.7_A2.4_T2.js + * @description Checking with "throw" + */ + +//CHECK#1 +var x = function () { throw "x"; }; +var y = function () { throw "y"; }; +try { + x() in y(); + $ERROR('#1.1: var x = function () { throw "x"; }; var y = function () { throw "y"; }; x() in y() throw "x". Actual: ' + (x() in 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() in y() throw "x". Actual: ' + (e)); + } + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.4_T3.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A2.4_T3.js new file mode 100644 index 000000000..22744621a --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_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.8/11.8.7/S11.8.7_A2.4_T3.js + * @description Checking with undeclarated variables + */ + +//CHECK#1 +try { + max_value in (max_value = "MAX_VALUE", Number); + $ERROR('#1.1: max_value in (max_value = "MAX_VALUE", Number) throw ReferenceError. Actual: ' + (max_value in (max_value = "MAX_VALUE", Number))); +} +catch (e) { + if ((e instanceof ReferenceError) !== true) { + $ERROR('#1.2: max_value in (max_value = "MAX_VALUE", Number) throw ReferenceError. Actual: ' + (e)); + } +} + +//CHECK#2 +if ((NUMBER = Number, "MAX_VALUE") in NUMBER !== true) { + $ERROR('#2: (NUMBER = Number, "MAX_VALUE") in NUMBER !== true'); +} + + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A3.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A3.js new file mode 100644 index 000000000..56dc73198 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A3.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 ShiftExpression is not an object, throw TypeError + * + * @path ch11/11.8/11.8.7/S11.8.7_A3.js + * @description Checking all the types of primitives + */ + +//CHECK#1 +try { + "toString" in true; + $ERROR('#1: "toString" in true throw TypeError'); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#1: "toString" in true throw TypeError'); + } +} + +//CHECK#2 +try { + "MAX_VALUE" in 1; + $ERROR('#2: "MAX_VALUE" in 1 throw TypeError'); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#2: "MAX_VALUE" in 1 throw TypeError'); + } +} + +//CHECK#3 +try { + "length" in "string"; + $ERROR('#3: "length" in "string" throw TypeError'); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#3: "length" in "string" throw TypeError'); + } +} + +//CHECK#4 +try { + "toString" in undefined; + $ERROR('#4: "toString" in undefined throw TypeError'); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#4: "toString" in undefined throw TypeError'); + } +} + +//CHECK#5 +try { + "toString" in null; + $ERROR('#5: "toString" in null throw TypeError'); +} +catch (e) { + if ((e instanceof TypeError) !== true) { + $ERROR('#5: "toString" in null throw TypeError'); + } +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A4.js b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A4.js new file mode 100644 index 000000000..fcb4a6b86 --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/S11.8.7_A4.js @@ -0,0 +1,38 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Operator "in" calls ToString(ShiftExpression) + * + * @path ch11/11.8/11.8.7/S11.8.7_A4.js + * @description Checking ToString coversion; + */ + +//CHECK#1 +var object = {}; +object["true"] = 1; +if (true in object !== "true" in object) { + $ERROR('#1: "var object = {}; object["true"] = 1; true in object === "true" in object'); +} + +//CHECK#2 +var object = {}; +object.Infinity = 1; +if (Infinity in object !== "Infinity" in object) { + $ERROR('#2: "var object = {}; object.Infinity = 1; Infinity in object === "Infinity" in object'); +} + +//CHECK#4 +var object = {}; +object.undefined = 1; +if (undefined in object !== "undefined" in object) { + $ERROR('#4: "var object = {}; object.undefined = 1; undefined in object === "undefined" in object'); +} + +//CHECK#5 +var object = {}; +object["null"] = 1; +if (null in object !== "null" in object) { + $ERROR('#5: "var object = {}; object["null"] = 1; null in object === "null" in object'); +} + diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/browser.js b/js/src/tests/test262/ch11/11.8/11.8.7/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/browser.js diff --git a/js/src/tests/test262/ch11/11.8/11.8.7/shell.js b/js/src/tests/test262/ch11/11.8/11.8.7/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/11.8.7/shell.js diff --git a/js/src/tests/test262/ch11/11.8/browser.js b/js/src/tests/test262/ch11/11.8/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/browser.js diff --git a/js/src/tests/test262/ch11/11.8/shell.js b/js/src/tests/test262/ch11/11.8/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.8/shell.js |