summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/void
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/language/expressions/void
parentInitial commit. (diff)
downloadfirefox-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/void')
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A1.js62
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A2_T1.js27
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A2_T2.js14
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A4_T1.js22
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A4_T2.js22
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A4_T3.js28
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A4_T4.js22
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A4_T5.js22
-rw-r--r--js/src/tests/test262/language/expressions/void/S11.4.2_A4_T6.js20
-rw-r--r--js/src/tests/test262/language/expressions/void/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/void/shell.js0
11 files changed, 239 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A1.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A1.js
new file mode 100644
index 0000000000..3b2c7661ff
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A1.js
@@ -0,0 +1,62 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: |
+ White Space and Line Terminator between "void" and UnaryExpression are
+ allowed
+es5id: 11.4.2_A1
+description: Checking by using eval
+---*/
+
+//CHECK#1
+if (eval("void\u00090") !== undefined) {
+ throw new Test262Error('#1: void\\u00090 === undefined');
+}
+
+//CHECK#2
+if (eval("void\u000B0") !== undefined) {
+ throw new Test262Error('#2: void\\u000B0 === undefined');
+}
+
+//CHECK#3
+if (eval("void\u000C0") !== undefined) {
+ throw new Test262Error('#3: void\\u000C0 === undefined');
+}
+
+//CHECK#4
+if (eval("void\u00200") !== undefined) {
+ throw new Test262Error('#4: void\\u00200 === undefined');
+}
+
+//CHECK#5
+if (eval("void\u00A00") !== undefined) {
+ throw new Test262Error('#5: void\\u00A00 === undefined');
+}
+
+//CHECK#6
+if (eval("void\u000A0") !== undefined) {
+ throw new Test262Error('#6: void\\u000A0 === undefined');
+}
+
+//CHECK#7
+if (eval("void\u000D0") !== undefined) {
+ throw new Test262Error('#7: void\\u000D0 === undefined');
+}
+
+//CHECK#8
+if (eval("void\u20280") !== undefined) {
+ throw new Test262Error('#8: void\\u20280 === undefined');
+}
+
+//CHECK#9
+if (eval("void\u20290") !== undefined) {
+ throw new Test262Error('#9: void\\u20290 === undefined');
+}
+
+//CHECK#10
+if (eval("void\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== undefined) {
+ throw new Test262Error('#10: void\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290 === undefined');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A2_T1.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A2_T1.js
new file mode 100644
index 0000000000..70f142615d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A2_T1.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: Operator "void" uses GetValue
+es5id: 11.4.2_A2_T1
+description: Either Type(x) is not Reference or GetBase(x) is not null
+---*/
+
+//CHECK#1
+if (void 0 !== undefined) {
+ throw new Test262Error('#1: void 0 === undefined. Actual: ' + (void 0));
+}
+
+//CHECK#2
+var x = 0;
+if (void x !== undefined) {
+ throw new Test262Error('#2: var x = 0; void x === undefined. Actual: ' + (void x));
+}
+
+//CHECK#3
+var x = new Object();
+if (void x !== undefined) {
+ throw new Test262Error('#3: var x = new Object(); void x === undefined. Actual: ' + (void x));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A2_T2.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A2_T2.js
new file mode 100644
index 0000000000..b561464a98
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A2_T2.js
@@ -0,0 +1,14 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator "void" uses GetValue
+es5id: 11.4.2_A2_T2
+description: If GetBase(x) is null, throw ReferenceError
+---*/
+
+assert.throws(ReferenceError, function() {
+ void x;
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T1.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T1.js
new file mode 100644
index 0000000000..081a64421b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T1.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator "void" evaluates UnaryExpression and returns undefined
+es5id: 11.4.2_A4_T1
+description: Type(x) is boolean primitive or Boolean object
+---*/
+
+//CHECK#1
+var x = false;
+if (void x !== undefined) {
+ throw new Test262Error('#1: var x = false; void x === undefined. Actual: ' + (void x));
+}
+
+//CHECK#2
+var x = new Boolean(true);
+if (void x !== undefined) {
+ throw new Test262Error('#2: var x = new Boolean(true); void x === undefined. Actual: ' + (void x));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T2.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T2.js
new file mode 100644
index 0000000000..8fc64e42b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T2.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator "void" evaluates UnaryExpression and returns undefined
+es5id: 11.4.2_A4_T2
+description: Type(x) is number primitive or Number object
+---*/
+
+//CHECK#1
+var x = 0.1;
+if (void x !== undefined) {
+ throw new Test262Error('#1: var x = 0.1; void x === undefined. Actual: ' + (void x));
+}
+
+//CHECK#2
+var x = new Number(-1.1);
+if (void x !== undefined) {
+ throw new Test262Error('#2: var x = new Number(-1.1); void x === undefined. Actual: ' + (void x));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T3.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T3.js
new file mode 100644
index 0000000000..2339a07c0f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_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: Operator "void" evaluates UnaryExpression and returns undefined
+es5id: 11.4.2_A4_T3
+description: Type(x) is string primitive of String object
+---*/
+
+//CHECK#1
+var x = "1";
+if (void x !== undefined) {
+ throw new Test262Error('#1: var x = "1"; void x === undefined. Actual: ' + (void x));
+}
+
+//CHECK#2
+var x = "x";
+if (isNaN(void x) !== true) {
+ throw new Test262Error('#2: var x = "x"; void x === undefined. Actual: ' + (void x));
+}
+
+//CHECK#3
+var x = new String("-1");
+if (void x !== undefined) {
+ throw new Test262Error('#3: var x = new String("-1"); void x === undefined. Actual: ' + (void x));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T4.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T4.js
new file mode 100644
index 0000000000..8aeb99a2c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T4.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator "void" evaluates UnaryExpression and returns undefined
+es5id: 11.4.2_A4_T4
+description: Type(x) is undefined or null
+---*/
+
+//CHECK#1
+var x;
+if (isNaN(void x) !== true) {
+ throw new Test262Error('#1: var x; void x === undefined. Actual: ' + (void x));
+}
+
+//CHECK#2
+var x = null;
+if (void x !== undefined) {
+ throw new Test262Error('#2: var x = null; void x === undefined. Actual: ' + (void x));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T5.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T5.js
new file mode 100644
index 0000000000..14d02a101b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T5.js
@@ -0,0 +1,22 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator "void" evaluates UnaryExpression and returns undefined
+es5id: 11.4.2_A4_T5
+description: Type(x) is Object object or Function object
+---*/
+
+//CHECK#1
+var x = {};
+if (isNaN(void x) !== true) {
+ throw new Test262Error('#1: var x = {}; void x === undefined. Actual: ' + (void x));
+}
+
+//CHECK#2
+var x = function(){return 1};
+if (isNaN(void x) !== true) {
+ throw new Test262Error('#2: var x = function(){return 1}; void x === undefined. Actual: ' + (void x));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T6.js b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T6.js
new file mode 100644
index 0000000000..e936bed38c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/S11.4.2_A4_T6.js
@@ -0,0 +1,20 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+info: Operator "void" evaluates UnaryExpression and returns undefined
+es5id: 11.4.2_A4_T6
+description: Checking Simple Assignment operator
+---*/
+
+//CHECK#1
+var x = 0;
+if (void (x = 1) !== undefined) {
+ throw new Test262Error('#1: var x = 0; void (x = 1) === undefined. Actual: ' + (void (x = 1)));
+} else {
+ if (x !== 1) {
+ throw new Test262Error('#1: var x = 0; void (x = 1); x === 1. Actual: ' + (x));
+ }
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/void/browser.js b/js/src/tests/test262/language/expressions/void/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/browser.js
diff --git a/js/src/tests/test262/language/expressions/void/shell.js b/js/src/tests/test262/language/expressions/void/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/void/shell.js