diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch11/11.8/11.8.7 | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/test262/ch11/11.8/11.8.7')
11 files changed, 316 insertions, 0 deletions
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 |