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.4/11.4.9 | |
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.4/11.4.9')
11 files changed, 324 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A1.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A1.js new file mode 100644 index 000000000..e4c26d0a1 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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.9/S11.4.9_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("!\u0009true") !== false) { + $ERROR('#true: !\\u0009true === false'); +} + +//CHECK#2 +if (eval("!\u000Btrue") !== false) { + $ERROR('#2: !\\u000Btrue === false'); +} + +//CHECK#3 +if (eval("!\u000Ctrue") !== false) { + $ERROR('#3: !\\u000Ctrue === false'); +} + +//CHECK#4 +if (eval("!\u0020true") !== false) { + $ERROR('#4: !\\u0020 === false'); +} + +//CHECK#5 +if (eval("!\u00A0true") !== false) { + $ERROR('#5: !\\u00A0true === false'); +} + +//CHECK#6 +if (eval("!\u000Atrue") !== false) { + $ERROR('#6: !\\u000Atrue === false'); +} + +//CHECK#7 +if (eval("!\u000Dtrue") !== false) { + $ERROR('#7: !\\u000Dtrue === false'); +} + +//CHECK#8 +if (eval("!\u2028true") !== false) { + $ERROR('#8: !\\u2028true === false'); +} + +//CHECK#9 +if (eval("!\u2029true") !== false) { + $ERROR('#9: !\\u2029true === false'); +} + +//CHECK#10 +if (eval("!\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029true") !== false) { + $ERROR('#10: !\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029true === false'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A2.1_T1.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A2.1_T1.js new file mode 100644 index 000000000..d08fdd181 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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.9/S11.4.9_A2.1_T1.js + * @description Either Type(x) is not Reference or GetBase(x) is not null + */ + +//CHECK#1 +if (!true !== false) { + $ERROR('#1: !true === false'); +} + +//CHECK#2 +if (!(!true) !== true) { + $ERROR('#2: !(!true) === true'); +} + +//CHECK#3 +var x = true; +if (!x !== false) { + $ERROR('#3: var x = true; !x === false'); +} + +//CHECK#4 +var x = true; +if (!(!x) !== true) { + $ERROR('#4: var x = true; !(!x) === true'); +} + +//CHECK#5 +var object = new Object(); +object.prop = true; +if (!object.prop !== false) { + $ERROR('#5: var object = new Object(); object.prop = true; !object.prop === false'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A2.1_T2.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A2.1_T2.js new file mode 100644 index 000000000..b6592471d --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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.9/S11.4.9_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.9/S11.4.9_A2.2_T1.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A2.2_T1.js new file mode 100644 index 000000000..3f156e9d4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A2.2_T1.js @@ -0,0 +1,58 @@ +// 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.9/S11.4.9_A2.2_T1.js + * @description If Type(value) is Object, return false + */ + +//CHECK#1 +var object = {valueOf: function() {return 1}}; +if (!object !== false) { + $ERROR('#1: var object = {valueOf: function() {return 1}}; !object === false. Actual: ' + (!object)); +} + +//CHECK#2 +var object = {valueOf: function() {return 1}, toString: function() {return 0}}; +if (!object !== false) { + $ERROR('#2: var object = {valueOf: function() {return 1}, toString: function() {return 0}}; !object === false. Actual: ' + (!object)); +} + +//CHECK#3 +var object = {valueOf: function() {return 1}, toString: function() {return {}}}; +if (!object !== false) { + $ERROR('#3: var object = {valueOf: function() {return 1}, toString: function() {return {}}}; !object === false. Actual: ' + (!object)); +} + +//CHECK#4 +var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; +if (!object !== false) { + $ERROR('#4: var object = {valueOf: function() {return 1}, toString: function() {throw "error"}}; !object === false. Actual: ' + (!object)); +} + +//CHECK#5 +var object = {toString: function() {return 1}}; +if (!object !== false) { + $ERROR('#5: var object = {toString: function() {return 1}}; !object === false. Actual: ' + (!object)); +} + +//CHECK#6 +var object = {valueOf: function() {return {}}, toString: function() {return 1}} +if (!object !== false) { + $ERROR('#6: var object = {valueOf: function() {return {}}, toString: function() {return 1}}; !object === false. Actual: ' + (!object)); +} + +//CHECK#7 +var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; +if (!object !== false) { + $ERROR('#7: var object = {valueOf: function() {throw "error"}, toString: function() {return 1}}; !object === false. Actual: ' + (!object)); +} + +//CHECK#8 +var object = {valueOf: function() {return {}}, toString: function() {return {}}}; +if (!object !== false) { + $ERROR('#8: var object = {valueOf: function() {return {}}, toString: function() {return {}}}; !object === false. Actual: ' + (!object)); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T1.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T1.js new file mode 100644 index 000000000..05a4ebcc7 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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 !ToBoolean(x) + * + * @path ch11/11.4/11.4.9/S11.4.9_A3_T1.js + * @description Type(x) is boolean primitive or Boolean object + */ + +//CHECK#1 +if (!false !== true) { + $ERROR('#1: !false === true'); +} + +//CHECK#2 +if (!new Boolean(true) !== false) { + $ERROR('#2: !new Boolean(true) === false'); +} + +//CHECK#3 +if (!new Boolean(false) !== false) { + $ERROR('#3: !new Boolean(false) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T2.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T2.js new file mode 100644 index 000000000..a2e13b0c0 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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 !ToBoolean(x) + * + * @path ch11/11.4/11.4.9/S11.4.9_A3_T2.js + * @description Type(x) is number primitive or Number object + */ + +//CHECK#1 +if (!0.1 !== false) { + $ERROR('#1: !0.1 === false'); +} + +//CHECK#2 +if (!new Number(-0.1) !== false) { + $ERROR('#2: !new Number(-0.1) === false'); +} + +//CHECK#3 +if (!NaN !== true) { + $ERROR('#3: !NaN === true'); +} + +//CHECK#4 +if (!new Number(NaN) !== false) { + $ERROR('#4: !new Number(NaN) === false'); +} + +//CHECK#5 +if (!0 !== true) { + $ERROR('#5: !0 === true'); +} + +//CHECK#6 +if (!new Number(0) !== false) { + $ERROR('#6: !new Number(0) === false'); +} + +//CHECK#7 +if (!Infinity !== false) { + $ERROR('#7: !Infinity === false'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T3.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T3.js new file mode 100644 index 000000000..a15994ddc --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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 !ToBoolean(x) + * + * @path ch11/11.4/11.4.9/S11.4.9_A3_T3.js + * @description Type(x) is string primitive or String object + */ + +//CHECK#1 +if (!"1" !== false) { + $ERROR('#1: !"1" === false'); +} + +//CHECK#2 +if (!new String("0") !== false) { + $ERROR('#2: !new String("0") === false'); +} + +//CHECK#3 +if (!"x" !== false) { + $ERROR('#3: !"x" === false'); +} + +//CHECK#4 +if (!"" !== true) { + $ERROR('#4: !"" === true'); +} + +//CHECK#5 +if (!new String("") !== false) { + $ERROR('#5: !new String("") === false'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T4.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T4.js new file mode 100644 index 000000000..0ac35bb98 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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 !ToBoolean(x) + * + * @path ch11/11.4/11.4.9/S11.4.9_A3_T4.js + * @description Type(x) is undefined or null + */ + +//CHECK#1 +if (!void 0 !== true) { + $ERROR('#1: !void 0 === true'); +} + +//CHECK#2 +if (!null !== true) { + $ERROR('#2: !null === true'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T5.js b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_A3_T5.js new file mode 100644 index 000000000..88f6dcaec --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/S11.4.9_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 !ToBoolean(x) + * + * @path ch11/11.4/11.4.9/S11.4.9_A3_T5.js + * @description Type(x) is Object object or Function object + */ + +//CHECK#1 +if ((!{}) !== false) { + $ERROR('#1: !({}) === false'); +} + +//CHECK#2 +if (!(function(){return 1}) !== false) { + $ERROR('#2: !(function(){return 1}) === false'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/browser.js b/js/src/tests/test262/ch11/11.4/11.4.9/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/browser.js diff --git a/js/src/tests/test262/ch11/11.4/11.4.9/shell.js b/js/src/tests/test262/ch11/11.4/11.4.9/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.9/shell.js |