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/ch09/9.4 | |
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/ch09/9.4')
-rw-r--r-- | js/src/tests/test262/ch09/9.4/S9.4_A1.js | 20 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.4/S9.4_A2.js | 21 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.4/S9.4_A3_T1.js | 83 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.4/S9.4_A3_T2.js | 41 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.4/browser.js | 0 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.4/shell.js | 0 |
6 files changed, 165 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch09/9.4/S9.4_A1.js b/js/src/tests/test262/ch09/9.4/S9.4_A1.js new file mode 100644 index 000000000..6c1b354c4 --- /dev/null +++ b/js/src/tests/test262/ch09/9.4/S9.4_A1.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. + +/** + * If ToNumber(value) is NaN, ToInteger(value) returns +0 + * + * @path ch09/9.4/S9.4_A1.js + * @description Check what position is defined by Number.NaN in string "abc": "abc".charAt(Number.NaN) + */ + +// CHECK#1 +if ("abc".charAt(Number.NaN) !== "a") { + $ERROR('#1: "abc".charAt(Number.NaN) === "a". Actual: ' + ("abc".charAt(Number.NaN))); +} + +// CHECK#2 +if ("abc".charAt("x") !== "a") { + $ERROR('#2: "abc".charAt("x") === "a". Actual: ' + ("abc".charAt("x"))); +} + diff --git a/js/src/tests/test262/ch09/9.4/S9.4_A2.js b/js/src/tests/test262/ch09/9.4/S9.4_A2.js new file mode 100644 index 000000000..6b0ac54ac --- /dev/null +++ b/js/src/tests/test262/ch09/9.4/S9.4_A2.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. + +/** + * If ToNumber(value) is +0, -0, +Infinity, or -Infinity, + * return ToNumber(value) + * + * @path ch09/9.4/S9.4_A2.js + * @description Check what position is defined by Number.NaN in string "abc": "abc".charAt(Number.NaN) + */ + +// CHECK#1 +if ("abc".charAt(0.0) !== "a") { + $ERROR('#1: "abc".charAt(0.0) === "a". Actual: ' + ("abc".charAt(0.0))); +} + +// CHECK#2 +if ("abc".charAt(-0.0) !== "a") { + $ERROR('#2: "abc".charAt(-0.0) === "a". Actual: ' + ("abc".charAt(-0.0))); +} + diff --git a/js/src/tests/test262/ch09/9.4/S9.4_A3_T1.js b/js/src/tests/test262/ch09/9.4/S9.4_A3_T1.js new file mode 100644 index 000000000..d16c30b38 --- /dev/null +++ b/js/src/tests/test262/ch09/9.4/S9.4_A3_T1.js @@ -0,0 +1,83 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Result of ToInteger(value) conversion is the result of computing + * sign(ToNumber(value)) * floor(abs(ToNumber(value))) + * + * @path ch09/9.4/S9.4_A3_T1.js + * @description For testing constructor Date(Number) is used + */ + +// CHECK#1 +var d1 = new Date(6.54321); +if (d1.valueOf() !== 6) { + $ERROR('#1: var d1 = new Date(6.54321); d1.valueOf() === 6;'); +} + +// CHECK#2 +var d2 = new Date(-6.54321); +if (d2.valueOf() !== -6) { + $ERROR('#2: var d2 = new Date(-6.54321); d2.valueOf() === -6;'); +} + +// CHECK#3 +var d3 = new Date(6.54321e2); +if (d3.valueOf() !== 654) { + $ERROR('#3: var d3 = new Date(6.54321e2); d3.valueOf() === 654;'); +} + +// CHECK#4 +var d4 = new Date(-6.54321e2); +if (d4.valueOf() !== -654) { + $ERROR('#4: var d4 = new Date(-6.54321e2); d4.valueOf() === -654;'); +} + +// CHECK#5 +var d5 = new Date(0.654321e1); +if (d5.valueOf() !== 6) { + $ERROR('#5: var d5 = new Date(0.654321e1); d5.valueOf() === 6;'); +} + +// CHECK#6 +var d6 = new Date(-0.654321e1); +if (d6.valueOf() !== -6) { + $ERROR('#6: var d6 = new Date(-0.654321e1); d6.valueOf() === -6;'); +} + +// CHECK#7 +var d7 = new Date(true); +if (d7.valueOf() !== 1) { + $ERROR('#7: var d7 = new Date(true); d7.valueOf() === 1;'); +} + +// CHECK#8 +var d8 = new Date(false); +if (d8.valueOf() !== 0) { + $ERROR('#8: var d8 = new Date(false); d8.valueOf() === 0;'); +} + +// CHECK#9 +var d9 = new Date(1.23e15); +if (d9.valueOf() !== 1.23e15) { + $ERROR('#9: var d9 = new Date(1.23e15); d9.valueOf() === 1.23e15;'); +} + +// CHECK#10 +var d10 = new Date(-1.23e15); +if (d10.valueOf() !== -1.23e15) { + $ERROR('#10: var d10 = new Date(-1.23e15); d10.valueOf() === -1.23e15;'); +} + +// CHECK#11 +var d11 = new Date(1.23e-15); +if (d11.valueOf() !== 0) { + $ERROR('#11: var d11 = new Date(1.23e-15); d11.valueOf() === 0;'); +} + +// CHECK#12 +var d12 = new Date(-1.23e-15); +if (d12.valueOf() !== -0) { + $ERROR('#12: var d12 = new Date(-1.23e-15); d12.valueOf() === -0;'); +} + diff --git a/js/src/tests/test262/ch09/9.4/S9.4_A3_T2.js b/js/src/tests/test262/ch09/9.4/S9.4_A3_T2.js new file mode 100644 index 000000000..f3a9796e8 --- /dev/null +++ b/js/src/tests/test262/ch09/9.4/S9.4_A3_T2.js @@ -0,0 +1,41 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Result of ToInteger(value) conversion is the result of computing + * sign(ToNumber(value)) * floor(abs(ToNumber(value))) + * + * @path ch09/9.4/S9.4_A3_T2.js + * @description For testing constructor Date(NaN, Infinity, Infinity, +0 and -0) is used + */ + +// CHECK#1 +var d1 = new Date(Number.NaN); +if (!isNaN(d1.valueOf())) { + $ERROR('#1: var d1 = new Date(Number.NaN); d1.valueOf() === Number.NaN;'); +} + +// CHECK#2 +var d2 = new Date(Infinity); +if (!isNaN(d2.valueOf())) { + $ERROR('#2: var d2 = new Date(Infinity); d2.valueOf() === Number.NaN;'); +} + +// CHECK#3 +var d3 = new Date(-Infinity); +if (!isNaN(d3.valueOf())) { + $ERROR('#3: var d3 = new Date(-Infinity); d3.valueOf() === Number.NaN;'); +} + +// CHECK#4 +var d4 = new Date(0); +if (d4.valueOf() !== 0) { + $ERROR('#4: var d4 = new Date(0); d4.valueOf() === 0;'); +} + +// CHECK#5 +var d5 = new Date(-0); +if (d5.valueOf() !== -0) { + $ERROR('#5: var d5 = new Date(-0); d5.valueOf() === -0;'); +} + diff --git a/js/src/tests/test262/ch09/9.4/browser.js b/js/src/tests/test262/ch09/9.4/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch09/9.4/browser.js diff --git a/js/src/tests/test262/ch09/9.4/shell.js b/js/src/tests/test262/ch09/9.4/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch09/9.4/shell.js |