summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/ch11/11.4/11.4.8
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/tests/test262/ch11/11.4/11.4.8
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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.4/11.4.8')
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A1.js60
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.1_T1.js39
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.1_T2.js22
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.2_T1.js79
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T1.js25
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T2.js45
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T3.js35
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T4.js20
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T5.js20
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/browser.js0
-rw-r--r--js/src/tests/test262/ch11/11.4/11.4.8/shell.js0
11 files changed, 345 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A1.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A1.js
new file mode 100644
index 000000000..7a646edfd
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_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 "~" and UnaryExpression are allowed
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A1.js
+ * @description Checking by using eval
+ */
+
+//CHECK#1
+if (eval("~\u00090") !== -1) {
+ $ERROR('#0: ~\\u00090 === -1');
+}
+
+//CHECK#2
+if (eval("~\u000B0") !== -1) {
+ $ERROR('#2: ~\\u000B0 === -1');
+}
+
+//CHECK#3
+if (eval("~\u000C0") !== -1) {
+ $ERROR('#3: ~\\u000C0 === -1');
+}
+
+//CHECK#4
+if (eval("~\u00200") !== -1) {
+ $ERROR('#4: ~\\u0020 === -1');
+}
+
+//CHECK#5
+if (eval("~\u00A00") !== -1) {
+ $ERROR('#5: ~\\u00A00 === -1');
+}
+
+//CHECK#6
+if (eval("~\u000A0") !== -1) {
+ $ERROR('#6: ~\\u000A0 === -1');
+}
+
+//CHECK#7
+if (eval("~\u000D0") !== -1) {
+ $ERROR('#7: ~\\u000D0 === -1');
+}
+
+//CHECK#8
+if (eval("~\u20280") !== -1) {
+ $ERROR('#8: ~\\u20280 === -1');
+}
+
+//CHECK#9
+if (eval("~\u20290") !== -1) {
+ $ERROR('#9: ~\\u20290 === -1');
+}
+
+//CHECK#10
+if (eval("~\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== -1) {
+ $ERROR('#10: ~\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290 === -1');
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.1_T1.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.1_T1.js
new file mode 100644
index 000000000..6dc44f7ae
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.1_T1.js
@@ -0,0 +1,39 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Operator ~x uses GetValue
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A2.1_T1.js
+ * @description Either Type(x) is not Reference or GetBase(x) is not null
+ */
+
+//CHECK#1
+if (~0 !== -1) {
+ $ERROR('#1: ~0 === -1. Actual: ' + (~0));
+}
+
+//CHECK#2
+if (~(~0) !== 0) {
+ $ERROR('#2: ~(~0) === 0. Actual: ' + (~(~0)));
+}
+
+//CHECK#3
+var x = 0;
+if (~x !== -1) {
+ $ERROR('#3: var x = 0; ~x === -1. Actual: ' + (~x));
+}
+
+//CHECK#4
+var x = 0;
+if (~(~x) !== 0) {
+ $ERROR('#4: var x = 0; ~(~x) === 0. Actual: ' + (~(~x)));
+}
+
+//CHECK#5
+var object = new Object();
+object.prop = 0;
+if (~object.prop !== -1) {
+ $ERROR('#5: var object = new Object(); object.prop = 0; ~object.prop === -1. Actual: ' + (~object.prop));
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.1_T2.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.1_T2.js
new file mode 100644
index 000000000..3f53f4673
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_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 uses GetValue
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A2.1_T2.js
+ * @description If GetBase(x) is null, throw ReferenceError
+ */
+
+//CHECK#1
+try {
+ ~x;
+ $ERROR('#1.1: ~x throw ReferenceError. Actual: ' + (~x));
+}
+catch (e) {
+ if ((e instanceof ReferenceError) !== true) {
+ $ERROR('#1.2: ~x throw ReferenceError. Actual: ' + (e));
+ }
+}
+
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.2_T1.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.2_T1.js
new file mode 100644
index 000000000..44b5e6127
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A2.2_T1.js
@@ -0,0 +1,79 @@
+// Copyright 2009 the Sputnik authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * Operator ~x uses [[Default Value]]
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A2.2_T1.js
+ * @description If Type(value) is Object, evaluate ToPrimitive(value, Number)
+ */
+
+//CHECK#1
+var object = {valueOf: function() {return 1}};
+if (~object !== -2) {
+ $ERROR('#1: var object = {valueOf: function() {return 1}}; ~object === -2. Actual: ' + (~object));
+}
+
+//CHECK#2
+var object = {valueOf: function() {return 1}, toString: function() {return 0}};
+if (~object !== -2) {
+ $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; ~object === -2. Actual: ' + (~object));
+}
+
+//CHECK#3
+var object = {valueOf: function() {return 1}, toString: function() {return {}}};
+if (~object !== -2) {
+ $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; ~object === -2. Actual: ' + (~object));
+}
+
+//CHECK#4
+try {
+ var object = {valueOf: function() {return 1}, toString: function() {throw "error"}};
+ if (~object !== -2) {
+ $ERROR('#4.1: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; ~object === -2. Actual: ' + (~object));
+ }
+}
+catch (e) {
+ if (e === "error") {
+ $ERROR('#4.2: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; ~object not throw "error"');
+ } else {
+ $ERROR('#4.3: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; ~object not throw Error. Actual: ' + (e));
+ }
+}
+
+//CHECK#5
+var object = {toString: function() {return 1}};
+if (~object !== -2) {
+ $ERROR('#5: var object = {toString: function() {return 1}}; ~object === -2. Actual: ' + (~object));
+}
+
+//CHECK#6
+var object = {valueOf: function() {return {}}, toString: function() {return 1}}
+if (~object !== -2) {
+ $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; ~object === -2. Actual: ' + (~object));
+}
+
+//CHECK#7
+try {
+ var object = {valueOf: function() {throw "error"}, toString: function() {return 1}};
+ ~object;
+ $ERROR('#7.1: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; ~object throw "error". Actual: ' + (~object));
+}
+catch (e) {
+ if (e !== "error") {
+ $ERROR('#7.2: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; ~object throw "error". Actual: ' + (e));
+ }
+}
+
+//CHECK#8
+try {
+ var object = {valueOf: function() {return {}}, toString: function() {return {}}};
+ ~object;
+ $ERROR('#8.1: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; ~object throw TypeError. Actual: ' + (~object));
+}
+catch (e) {
+ if ((e instanceof TypeError) !== true) {
+ $ERROR('#8.2: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; ~object throw TypeError. Actual: ' + (e));
+ }
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T1.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T1.js
new file mode 100644
index 000000000..0958a0570
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T1.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.
+
+/**
+ * Operator ~x returns ~ToInt32(x)
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A3_T1.js
+ * @description Type(x) is boolean primitive or Boolean object
+ */
+
+//CHECK#1
+if (~false !== -1) {
+ $ERROR('#1: ~false === -1. Actual: ' + (~false));
+}
+
+//CHECK#2
+if (~new Boolean(true) !== -2) {
+ $ERROR('#2: ~new Boolean(true) === -2. Actual: ' + (~new Boolean(true)));
+}
+
+//CHECK#3
+if (~new Boolean(false) !== -1) {
+ $ERROR('#3: ~new Boolean(false) === -1. Actual: ' + (~new Boolean(false)));
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T2.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T2.js
new file mode 100644
index 000000000..a7b6d4bbc
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_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.
+
+/**
+ * Operator ~x returns ~ToInt32(x)
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A3_T2.js
+ * @description Type(x) is number primitive or Number object
+ */
+
+//CHECK#1
+if (~0.1 !== -1) {
+ $ERROR('#1: ~0.1 === -1. Actual: ' + (~0.1));
+}
+
+//CHECK#2
+if (~new Number(-0.1) !== -1) {
+ $ERROR('#2: ~new Number(-0.1) === -1. Actual: ' + (~new Number(-0.1)));
+}
+
+//CHECK#3
+if (~NaN !== -1) {
+ $ERROR('#3: ~NaN === -1. Actual: ' + (~NaN));
+}
+
+//CHECK#4
+if (~new Number(NaN) !== -1) {
+ $ERROR('#4: ~new Number(NaN) === -1. Actual: ' + (~new Number(NaN)));
+}
+
+//CHECK#5
+if (~1 !== -2) {
+ $ERROR('#5: ~1 === -2. Actual: ' + (~1));
+}
+
+//CHECK#6
+if (~new Number(-2) !== 1) {
+ $ERROR('#6: ~new Number(-2) === 1. Actual: ' + (~new Number(-2)));
+}
+
+//CHECK#7
+if (~Infinity !== -1) {
+ $ERROR('#7: ~Infinity === -1. Actual: ' + (~Infinity));
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T3.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T3.js
new file mode 100644
index 000000000..ec54ebd48
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T3.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 ~x returns ~ToInt32(x)
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A3_T3.js
+ * @description Type(x) is string primitive or String object
+ */
+
+//CHECK#1
+if (~"1" !== -2) {
+ $ERROR('#1: ~"1" === -2. Actual: ' + (~"1"));
+}
+
+//CHECK#2
+if (~new String("0") !== -1) {
+ $ERROR('#2: ~new String("0") === -1. Actual: ' + (~new String("0")));
+}
+
+//CHECK#3
+if (~"x" !== -1) {
+ $ERROR('#3: ~"x" === -1. Actual: ' + (~"x"));
+}
+
+//CHECK#4
+if (~"" !== -1) {
+ $ERROR('#4: ~"" === -1. Actual: ' + (~""));
+}
+
+//CHECK#5
+if (~new String("-2") !== 1) {
+ $ERROR('#5: ~new String("-2") === 1. Actual: ' + (~new String("-2")));
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T4.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T4.js
new file mode 100644
index 000000000..d8be652d4
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T4.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.
+
+/**
+ * Operator ~x returns ~ToInt32(x)
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A3_T4.js
+ * @description Type(x) is undefined or null
+ */
+
+//CHECK#1
+if (~void 0 !== -1) {
+ $ERROR('#1: ~void 0 === -1. Actual: ' + (~void 0));
+}
+
+//CHECK#2
+if (~null !== -1) {
+ $ERROR('#2: ~null === -1. Actual: ' + (~null));
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T5.js b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T5.js
new file mode 100644
index 000000000..8fcfc740b
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/S11.4.8_A3_T5.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.
+
+/**
+ * Operator ~x returns ~ToInt32(x)
+ *
+ * @path ch11/11.4/11.4.8/S11.4.8_A3_T5.js
+ * @description Type(x) is Object object or Function object
+ */
+
+//CHECK#1
+if (~({}) !== -1) {
+ $ERROR('#1: ~({}) === -1. Actual: ' + (~({})));
+}
+
+//CHECK#2
+if (~(function(){return 1}) !== -1) {
+ $ERROR('#2: ~(function(){return 1}) === -1. Actual: ' + (~(function(){return 1})));
+}
+
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/browser.js b/js/src/tests/test262/ch11/11.4/11.4.8/browser.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/browser.js
diff --git a/js/src/tests/test262/ch11/11.4/11.4.8/shell.js b/js/src/tests/test262/ch11/11.4/11.4.8/shell.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/src/tests/test262/ch11/11.4/11.4.8/shell.js