diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/language/expressions/grouping | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/expressions/grouping')
11 files changed, 243 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A1.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A1.js new file mode 100644 index 0000000000..e46ec0fa98 --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A1.js @@ -0,0 +1,62 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: White Space and Line Terminator inside "grouping" operator are allowed +es5id: 11.1.6_A1 +description: > + Inserting WhiteSpaces and LineTerminators into grouping operator. + Eval is used +---*/ + +//CHECK#1 +if (eval("(\u00091\u0009)") !== 1) { + throw new Test262Error('#1: (\\u00091\\u0009) === 1'); +} + +//CHECK#2 +if (eval("(\u000B1\u000B)") !== 1) { + throw new Test262Error('#2: (\\u000B1\\u000B) === 1'); +} + +//CHECK#3 +if (eval("(\u000C1\u000C)") !== 1) { + throw new Test262Error('#3: (\\u000C1\\u000C) === 1'); +} + +//CHECK#4 +if (eval("(\u00201\u0020)") !== 1) { + throw new Test262Error('#4: (\\u00201\\u0020 === 1'); +} + +//CHECK#5 +if (eval("(\u00A01\u00A0)") !== 1) { + throw new Test262Error('#5: (\\u00A01\\u00A0) === 1'); +} + +//CHECK#6 +if (eval("(\u000A1\u000A)") !== 1) { + throw new Test262Error('#6: (\\u000A1\\u000A) === 1'); +} + +//CHECK#7 +if (eval("(\u000D1\u000D)") !== 1) { + throw new Test262Error('#7: (\\u000D1\\u000D) === 1'); +} + +//CHECK#8 +if (eval("(\u20281\u2028)") !== 1) { + throw new Test262Error('#8: (\\u20281\\u2028) === 1'); +} + +//CHECK#9 +if (eval("(\u20291\u2029)") !== 1) { + throw new Test262Error('#9: (\\u20291\\u2029) === 1'); +} + +//CHECK#10 +if (eval("(\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20291\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029)") !== 1) { + throw new Test262Error('#10: (\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20291\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029) === 1'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A2_T1.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A2_T1.js new file mode 100644 index 0000000000..422794e8c2 --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A2_T1.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. + +/*--- +info: | + "This" operator doesn't use GetValue. The operators "delete" and "typeof" + can be applied to parenthesised expressions +es5id: 11.1.6_A2_T1 +description: > + Applying "delete" and "typeof" operators to an undefined variable + and a property of an object +---*/ + +//CHECK#1 +if (typeof (x) !== "undefined") { + throw new Test262Error('#1: typeof (x) === "undefined". Actual: ' + (typeof (x))); +} + +var object = {}; +//CHECK#2 +if (delete (object.prop) !== true) { + throw new Test262Error('#2: var object = {}; delete (object.prop) === true'); +} + +//CHECK#3 +if (typeof (object.prop) !== "undefined") { + throw new Test262Error('#3: var object = {}; typeof (object.prop) === "undefined". Actual: ' + (typeof (object.prop))); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A2_T2.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A2_T2.js new file mode 100644 index 0000000000..974abf0459 --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A2_T2.js @@ -0,0 +1,19 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + "This" operator doesn't use GetValue. The operators "delete" and "typeof" + can be applied to parenthesised expressions +es5id: 11.1.6_A2_T2 +description: > + Applying "delete" operator to an undefined variable +flags: [noStrict] +---*/ + +//CHECK#1 +if (delete (x) !== true) { + throw new Test262Error('#1: delete (x) === true'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T1.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T1.js new file mode 100644 index 0000000000..eba51a8bf6 --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_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. + +/*--- +info: "\"This\" operator only evaluates Expression" +es5id: 11.1.6_A3_T1 +description: Applying grouping operator to Boolean +---*/ + +// Check for Boolean + +//CHECK#1 +if ((true) !== true) { + throw new Test262Error('#1: (true) === true'); +} + +//CHECK#2 +var x = new Boolean(true); +if ((x) !== x) { + throw new Test262Error('#2: var x = new Boolean(true); (x) === x. Actual: ' + ((x))); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T2.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T2.js new file mode 100644 index 0000000000..56333e682a --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T2.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. + +/*--- +info: "\"This\" operator only evaluates Expression" +es5id: 11.1.6_A3_T2 +description: Applying grouping operator to Number +---*/ + +//Check for Number + +//CHECK#1 +if ((1) !== 1) { + throw new Test262Error('#1: (1) === 1. Actual: ' + ((1))); +} + +//CHECK#2 +var x = new Number(1); +if ((x) !== x) { + throw new Test262Error('#2: var x = new Number(1); (x) === x. Actual: ' + ((x))); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T3.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T3.js new file mode 100644 index 0000000000..ab17b6c73b --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T3.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "\"This\" operator only evaluates Expression" +es5id: 11.1.6_A3_T3 +description: Applying grouping operator to String +---*/ + +//Check for String + +//CHECK#1 +if (("1") !== "1") { + throw new Test262Error('#1: ("1") === "1". Actual: ' + (("1"))); +} + +//CHECK#2 +if (("x") !== "x") { + throw new Test262Error('#2: ("x") === "x". Actual: ' + (("x"))); +} + +//CHECK#3 +var x = new Number("1"); +if ((x) !== x) { + throw new Test262Error('#3: var x = new Number("1"); (x) === x. Actual: ' + ((x))); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T4.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T4.js new file mode 100644 index 0000000000..b5ae7c383c --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T4.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. + +/*--- +info: "\"This\" operator only evaluates Expression" +es5id: 11.1.6_A3_T4 +description: Applying grouping operator to undefined +---*/ + +//Check for undefined and null + +//CHECK#1 +if ((undefined) !== undefined) { + throw new Test262Error('#1: (undefined) === undefined. Actual: ' + ((undefined))); +} + +//CHECK#2 +if ((void 0) !== void 0) { + throw new Test262Error('#2: (void 0) === void 0. Actual: ' + ((void 0))); +} + +//CHECK#2 +if ((null) !== null) { + throw new Test262Error('#2: (null) === null. Actual: ' + ((null))); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T6.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T6.js new file mode 100644 index 0000000000..866c12c238 --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T6.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "\"This\" operator only evaluates Expression" +es5id: 11.1.6_A3_T6 +description: Applying grouping operator to delete operator +flags: [noStrict] +---*/ + +//CHECK#1 +if (delete (x) !== true) { + throw new Test262Error('#1: delete (x) === true'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T7.js b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T7.js new file mode 100644 index 0000000000..b4394b5f6a --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/S11.1.6_A3_T7.js @@ -0,0 +1,15 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "\"This\" operator only evaluates Expression" +es5id: 11.1.6_A3_T7 +description: Applying grouping operator to typeof operator +---*/ + +//CHECK#1 +if (typeof (x) !== "undefined") { + throw new Test262Error('#1: typeof (x) === "undefined". Actual: ' + (typeof (x))); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/grouping/browser.js b/js/src/tests/test262/language/expressions/grouping/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/browser.js diff --git a/js/src/tests/test262/language/expressions/grouping/shell.js b/js/src/tests/test262/language/expressions/grouping/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/expressions/grouping/shell.js |