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.2 | |
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.2')
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A1_T1.js | 30 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A1_T2.js | 25 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A2_T1.js | 15 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A2_T2.js | 15 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A3_T1.js | 20 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A3_T2.js | 20 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A4_T1.js | 25 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A4_T2.js | 25 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A4_T3.js | 51 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A4_T4.js | 51 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A5_T1.js | 15 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A5_T2.js | 15 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A5_T3.js | 20 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A5_T4.js | 20 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A6_T1.js | 105 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/S9.2_A6_T2.js | 105 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/browser.js | 0 | ||||
-rw-r--r-- | js/src/tests/test262/ch09/9.2/shell.js | 0 |
18 files changed, 557 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A1_T1.js b/js/src/tests/test262/ch09/9.2/S9.2_A1_T1.js new file mode 100644 index 000000000..44bbaae6a --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A1_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. + +/** + * Result of boolean conversion from undefined value is false + * + * @path ch09/9.2/S9.2_A1_T1.js + * @description Undefined, void and others are converted to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean(undefined) !== false) { + $ERROR('#1: Boolean(undefined) === false. Actual: ' + (Boolean(undefined))); +} + +// CHECK#2 +if (Boolean(void 0) !== false) { + $ERROR('#2: Boolean(undefined) === false. Actual: ' + (Boolean(undefined))); +} + +// CHECK#3 +if (Boolean(eval("var x")) !== false) { + $ERROR('#3: Boolean(eval("var x")) === false. Actual: ' + (Boolean(eval("var x")))); +} + +// CHECK#4 +if (Boolean() !== false) { + $ERROR('#4: Boolean() === false. Actual: ' + (Boolean())); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A1_T2.js b/js/src/tests/test262/ch09/9.2/S9.2_A1_T2.js new file mode 100644 index 000000000..0700b8da6 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A1_T2.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. + +/** + * Result of boolean conversion from undefined value is false + * + * @path ch09/9.2/S9.2_A1_T2.js + * @description Undefined, void and others are converted to Boolean by implicit transformation + */ + +// CHECK#1 +if (!(undefined) !== true) { + $ERROR('#1: !(undefined) === true. Actual: ' + (!(undefined))); +} + +// CHECK#2 +if (!(void 0) !== true) { + $ERROR('#2: !(undefined) === true. Actual: ' + (!(undefined))); +} + +// CHECK#3 +if (!(eval("var x")) !== true) { + $ERROR('#3: !(eval("var x")) === true. Actual: ' + (!(eval("var x")))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A2_T1.js b/js/src/tests/test262/ch09/9.2/S9.2_A2_T1.js new file mode 100644 index 000000000..c53da91bf --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A2_T1.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. + +/** + * Result of boolean conversion from null value is false + * + * @path ch09/9.2/S9.2_A2_T1.js + * @description null convert to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean(null) !== false) { + $ERROR('#1: Boolean(null) === false. Actual: ' + (Boolean(null))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A2_T2.js b/js/src/tests/test262/ch09/9.2/S9.2_A2_T2.js new file mode 100644 index 000000000..ffd391b90 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A2_T2.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. + +/** + * Result of boolean conversion from null value is false + * + * @path ch09/9.2/S9.2_A2_T2.js + * @description null convert to Boolean by implicit transformation + */ + +// CHECK#1 +if (!(null) !== true) { + $ERROR('#1: !(null) === true. Actual: ' + (!(null))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A3_T1.js b/js/src/tests/test262/ch09/9.2/S9.2_A3_T1.js new file mode 100644 index 000000000..103f4eab3 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A3_T1.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. + +/** + * Result of boolean conversion from boolean value is no conversion + * + * @path ch09/9.2/S9.2_A3_T1.js + * @description true and false convert to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean(true) !== true) { + $ERROR('#1: Boolean(true) === true. Actual: ' + (Boolean(true))); +} + +// CHECK#2 +if (Boolean(false) !== false) { + $ERROR('#2: Boolean(false) === false. Actual: ' + (Boolean(false))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A3_T2.js b/js/src/tests/test262/ch09/9.2/S9.2_A3_T2.js new file mode 100644 index 000000000..d1ede1c6d --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A3_T2.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. + +/** + * Result of boolean conversion from boolean value is no conversion + * + * @path ch09/9.2/S9.2_A3_T2.js + * @description true and false convert to Boolean by implicit transformation + */ + +// CHECK#1 +if (!(true) !== false) { + $ERROR('#1: !(true) === false. Actual: ' + (!(true))); +} + +// CHECK#2 +if (!(false) !== true) { + $ERROR('#2: !(false) === true. Actual: ' + (!(false))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A4_T1.js b/js/src/tests/test262/ch09/9.2/S9.2_A4_T1.js new file mode 100644 index 000000000..71860cac8 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A4_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. + +/** + * Result of boolean conversion from number value is false if the argument is +0, -0, or NaN; otherwise, is true + * + * @path ch09/9.2/S9.2_A4_T1.js + * @description +0, -0 and NaN convert to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean(+0) !== false) { + $ERROR('#1: Boolean(+0) === false. Actual: ' + (Boolean(+0))); +} + +// CHECK#2 +if (Boolean(-0) !== false) { + $ERROR('#2: Boolean(-0) === false. Actual: ' + (Boolean(-0))); +} + +// CHECK#3 +if (Boolean(Number.NaN) !== false) { + $ERROR('#3: Boolean(Number.NaN) === false. Actual: ' + (Boolean(Number.NaN))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A4_T2.js b/js/src/tests/test262/ch09/9.2/S9.2_A4_T2.js new file mode 100644 index 000000000..66047bea5 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A4_T2.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. + +/** + * Result of boolean conversion from number value is false if the argument is +0, -0, or NaN; otherwise, is true + * + * @path ch09/9.2/S9.2_A4_T2.js + * @description +0, -0 and NaN convert to Boolean by implicit transformation + */ + +// CHECK#1 +if (!(+0) !== true) { + $ERROR('#1: !(+0) === true. Actual: ' + (!(+0))); +} + +// CHECK#2 +if (!(-0) !== true) { + $ERROR('#2: !(-0) === true. Actual: ' + (!(-0))); +} + +// CHECK#3 +if (!(Number.NaN) !== true) { + $ERROR('#3: !(Number.NaN) === true. Actual: ' + (!(Number.NaN))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A4_T3.js b/js/src/tests/test262/ch09/9.2/S9.2_A4_T3.js new file mode 100644 index 000000000..9a16966d6 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A4_T3.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Result of boolean conversion from number value is false if the argument is +0, -0, or NaN; otherwise, is true + * + * @path ch09/9.2/S9.2_A4_T3.js + * @description Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, + * Number.MAX_VALUE, Number.MIN_VALUE and some numbers convert to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean(Number.POSITIVE_INFINITY) !== true) { + $ERROR('#1: Boolean(+Infinity) === true. Actual: ' + (Boolean(+Infinity))); +} + +// CHECK#2; +if (Boolean(Number.NEGATIVE_INFINITY) !== true) { + $ERROR('#2: Boolean(-Infinity) === true. Actual: ' + (Boolean(-Infinity))); +} + +// CHECK#3 +if (Boolean(Number.MAX_VALUE) !== true) { + $ERROR('#3: Boolean(Number.MAX_VALUE) === true. Actual: ' + (Boolean(Number.MAX_VALUE))); +} + +// CHECK#4 +if (Boolean(Number.MIN_VALUE) !== true) { + $ERROR('#4: Boolean(Number.MIN_VALUE) === true. Actual: ' + (Boolean(Number.MIN_VALUE))); +} + +// CHECK#5 +if (Boolean(13) !== true) { + $ERROR('#5: Boolean(13) === true. Actual: ' + (Boolean(13))); +} + +// CHECK#6 +if (Boolean(-13) !== true) { + $ERROR('#6: Boolean(-13) === true. Actual: ' + (Boolean(-13))); +} + +// CHECK#7 +if (Boolean(1.3) !== true) { + $ERROR('#7: Boolean(1.3) === true. Actual: ' + (Boolean(1.3))); +} + +// CHECK#8 +if (Boolean(-1.3) !== true) { + $ERROR('#8: Boolean(-1.3) === true. Actual: ' + (Boolean(-1.3))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A4_T4.js b/js/src/tests/test262/ch09/9.2/S9.2_A4_T4.js new file mode 100644 index 000000000..692ab77bf --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A4_T4.js @@ -0,0 +1,51 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Result of boolean conversion from number value is false if the argument is +0, -0, or NaN; otherwise, is true + * + * @path ch09/9.2/S9.2_A4_T4.js + * @description Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, + * Number.MAX_VALUE, Number.MIN_VALUE and some other numbers are converted to Boolean by implicit transformation + */ + +// CHECK#1 +if (!(Number.POSITIVE_INFINITY) !== false) { + $ERROR('#1: !(+Infinity) === false. Actual: ' + (!(+Infinity))); +} + +// CHECK#2; +if (!(Number.NEGATIVE_INFINITY) !== false) { + $ERROR('#2: !(-Infinity) === false. Actual: ' + (!(-Infinity))); +} + +// CHECK#3 +if (!(Number.MAX_VALUE) !== false) { + $ERROR('#3: !(Number.MAX_VALUE) === false. Actual: ' + (!(Number.MAX_VALUE))); +} + +// CHECK#4 +if (!(Number.MIN_VALUE) !== false) { + $ERROR('#4: !(Number.MIN_VALUE) === false. Actual: ' + (!(Number.MIN_VALUE))); +} + +// CHECK#5 +if (!(13) !== false) { + $ERROR('#5: !(13) === false. Actual: ' + (!(13))); +} + +// CHECK#6 +if (!(-13) !== false) { + $ERROR('#6: !(-13) === false. Actual: ' + (!(-13))); +} + +// CHECK#7 +if (!(1.3) !== false) { + $ERROR('#7: !(1.3) === false. Actual: ' + (!(1.3))); +} + +// CHECK#8 +if (!(-1.3) !== false) { + $ERROR('#8: !(-1.3) === false. Actual: ' + (!(-1.3))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A5_T1.js b/js/src/tests/test262/ch09/9.2/S9.2_A5_T1.js new file mode 100644 index 000000000..293ee2375 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A5_T1.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. + +/** + * Result of boolean conversion from nonempty string value (length is not zero) is true; from empty String (length is zero) is false + * + * @path ch09/9.2/S9.2_A5_T1.js + * @description "" is converted to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean("") !== false) { + $ERROR('#1: Boolean("") === false. Actual: ' + (Boolean(""))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A5_T2.js b/js/src/tests/test262/ch09/9.2/S9.2_A5_T2.js new file mode 100644 index 000000000..de391a329 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A5_T2.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. + +/** + * Result of boolean conversion from nonempty string value (length is not zero) is true; from empty String (length is zero) is false + * + * @path ch09/9.2/S9.2_A5_T2.js + * @description "" convert to Boolean by implicit transformation + */ + +// CHECK#1 +if (!("") !== true) { + $ERROR('#1: !("") === true. Actual: ' + (!(""))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A5_T3.js b/js/src/tests/test262/ch09/9.2/S9.2_A5_T3.js new file mode 100644 index 000000000..f8f185c59 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A5_T3.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. + +/** + * Result of boolean conversion from nonempty string value (length is not zero) is true; from empty String (length is zero) is false + * + * @path ch09/9.2/S9.2_A5_T3.js + * @description Any nonempty string convert to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean(" ") !== true) { + $ERROR('#1: Boolean(" ") === true. Actual: ' + (Boolean(" "))); +} + +// CHECK#2 +if (Boolean("Nonempty String") !== true) { + $ERROR('#2: Boolean("Nonempty String") === true. Actual: ' + (Boolean("Nonempty String"))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A5_T4.js b/js/src/tests/test262/ch09/9.2/S9.2_A5_T4.js new file mode 100644 index 000000000..c8ea44e9d --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A5_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. + +/** + * Result of boolean conversion from nonempty string value (length is not zero) is true; from empty String (length is zero) is false + * + * @path ch09/9.2/S9.2_A5_T4.js + * @description Any nonempty string convert to Boolean by implicit transformation + */ + +// CHECK#1 +if (!(" ") !== false) { + $ERROR('#1: !(" ") === false. Actual: ' + (!(" "))); +} + +// CHECK#2 +if (!("Nonempty String") !== false) { + $ERROR('#2: !("Nonempty String") === false. Actual: ' + (!("Nonempty String"))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A6_T1.js b/js/src/tests/test262/ch09/9.2/S9.2_A6_T1.js new file mode 100644 index 000000000..72bb34e26 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A6_T1.js @@ -0,0 +1,105 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Result of boolean conversion from object is true + * + * @path ch09/9.2/S9.2_A6_T1.js + * @description Different objects convert to Boolean by explicit transformation + */ + +// CHECK#1 +if (Boolean(new Object()) !== true) { + $ERROR('#1: Boolean(new Object()) === true. Actual: ' + (Boolean(new Object()))); +} + +// CHECK#2 +if (Boolean(new String("")) !== true) { + $ERROR('#2: Boolean(new String("")) === true. Actual: ' + (Boolean(new String("")))); +} + +// CHECK#3 +if (Boolean(new String()) !== true) { + $ERROR('#3: Boolean(new String()) === true. Actual: ' + (Boolean(new String()))); +} + +// CHECK#4 +if (Boolean(new Boolean(true)) !== true) { + $ERROR('#4: Boolean(new Boolean(true)) === true. Actual: ' + (Boolean(new Boolean(true)))); +} + +// CHECK#5 +if (Boolean(new Boolean(false)) !== true) { + $ERROR('#5: Boolean(new Boolean(false)) === true. Actual: ' + (Boolean(new Boolean(false)))); +} + +// CHECK#6 +if (Boolean(new Boolean()) !== true) { + $ERROR('#6: Boolean(new Boolean()) === true. Actual: ' + (Boolean(new Boolean()))); +} + +// CHECK#7 +if (Boolean(new Array()) !== true) { + $ERROR('#7: Boolean(new Array()) === true. Actual: ' + (Boolean(new Array()))); +} + +// CHECK#8 +if (Boolean(new Number()) !== true) { + $ERROR('#8: Boolean(new Number()) === true. Actual: ' + (Boolean(new Number()))); +} + +// CHECK#9 +if (Boolean(new Number(-0)) !== true) { + $ERROR('#9: Boolean(new Number(-0)) === true. Actual: ' + (Boolean(new Number(-0)))); +} + +// CHECK#10 +if (Boolean(new Number(0)) !== true) { + $ERROR('#10: Boolean(new Number(0)) === true. Actual: ' + (Boolean(new Number(0)))); +} + +// CHECK#11 +if (Boolean(new Number()) !== true) { + $ERROR('#11: Boolean(new Number()) === true. Actual: ' + (Boolean(new Number()))); +} + +// CHECK#12 +if (Boolean(new Number(Number.NaN)) !== true) { + $ERROR('#12: Boolean(new Number(Number.NaN)) === true. Actual: ' + (Boolean(new Number(Number.NaN)))); +} + +// CHECK#13 +if (Boolean(new Number(-1)) !== true) { + $ERROR('#13: Boolean(new Number(-1)) === true. Actual: ' + (Boolean(new Number(-1)))); +} + +// CHECK#14 +if (Boolean(new Number(1)) !== true) { + $ERROR('#14: Boolean(new Number(1)) === true. Actual: ' + (Boolean(new Number(1)))); +} + +// CHECK#15 +if (Boolean(new Number(Number.POSITIVE_INFINITY)) !== true) { + $ERROR('#15: Boolean(new Number(Number.POSITIVE_INFINITY)) === true. Actual: ' + (Boolean(new Number(Number.POSITIVE_INFINITY)))); +} + +// CHECK#16 +if (Boolean(new Number(Number.NEGATIVE_INFINITY)) !== true) { + $ERROR('#16: Boolean(new Number(Number.NEGATIVE_INFINITY)) === true. Actual: ' + (Boolean(new Number(Number.NEGATIVE_INFINITY)))); +} + +// CHECK#17 +if (Boolean(new Function()) !== true) { + $ERROR('#17: Boolean(new Function()) === true. Actual: ' + (Boolean(new Function()))); +} + +// CHECK#18 +if (Boolean(new Date()) !== true) { + $ERROR('#18: Boolean(new Date()) === true. Actual: ' + (Boolean(new Date()))); +} + +// CHECK#19 +if (Boolean(new Date(0)) !== true) { + $ERROR('#19: Boolean(new Date(0)) === true. Actual: ' + (Boolean(new Date(0)))); +} + diff --git a/js/src/tests/test262/ch09/9.2/S9.2_A6_T2.js b/js/src/tests/test262/ch09/9.2/S9.2_A6_T2.js new file mode 100644 index 000000000..54dbbb6f3 --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/S9.2_A6_T2.js @@ -0,0 +1,105 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * Result of boolean conversion from object is true + * + * @path ch09/9.2/S9.2_A6_T2.js + * @description Different objects convert to Boolean by implicit transformation + */ + +// CHECK#1 +if (!(new Object()) !== false) { + $ERROR('#1: !(new Object()) === false. Actual: ' + (!(new Object()))); +} + +// CHECK#2 +if (!(new String("")) !== false) { + $ERROR('#2: !(new String("")) === false. Actual: ' + (!(new String("")))); +} + +// CHECK#3 +if (!(new String()) !== false) { + $ERROR('#3: !(new String()) === false. Actual: ' + (!(new String()))); +} + +// CHECK#4 +if (!(new Boolean(true)) !== false) { + $ERROR('#4: !(new Boolean(true)) === false. Actual: ' + (!(new Boolean(true)))); +} + +// CHECK#5 +if (!(new Boolean(false)) !== false) { + $ERROR('#5: !(new Boolean(false)) === false. Actual: ' + (!(new Boolean(false)))); +} + +// CHECK#6 +if (!(new Boolean()) !== false) { + $ERROR('#6: !(new Boolean()) === false. Actual: ' + (!(new Boolean()))); +} + +// CHECK#7 +if (!(new Array()) !== false) { + $ERROR('#7: !(new Array()) === false. Actual: ' + (!(new Array()))); +} + +// CHECK#8 +if (!(new Number()) !== false) { + $ERROR('#8: !(new Number()) === false. Actual: ' + (!(new Number()))); +} + +// CHECK#9 +if (!(new Number(-0)) !== false) { + $ERROR('#9: !(new Number(-0)) === false. Actual: ' + (!(new Number(-0)))); +} + +// CHECK#10 +if (!(new Number(0)) !== false) { + $ERROR('#10: !(new Number(0)) === false. Actual: ' + (!(new Number(0)))); +} + +// CHECK#11 +if (!(new Number()) !== false) { + $ERROR('#11: !(new Number()) === false. Actual: ' + (!(new Number()))); +} + +// CHECK#12 +if (!(new Number(Number.NaN)) !== false) { + $ERROR('#12: !(new Number(Number.NaN)) === false. Actual: ' + (!(new Number(Number.NaN)))); +} + +// CHECK#13 +if (!(new Number(-1)) !== false) { + $ERROR('#13: !(new Number(-1)) === false. Actual: ' + (!(new Number(-1)))); +} + +// CHECK#14 +if (!(new Number(1)) !== false) { + $ERROR('#14: !(new Number(1)) === false. Actual: ' + (!(new Number(1)))); +} + +// CHECK#15 +if (!(new Number(Number.POSITIVE_INFINITY)) !== false) { + $ERROR('#15: !(new Number(Number.POSITIVE_INFINITY)) === false. Actual: ' + (!(new Number(Number.POSITIVE_INFINITY)))); +} + +// CHECK#16 +if (!(new Number(Number.NEGATIVE_INFINITY)) !== false) { + $ERROR('#16: !(new Number(Number.NEGATIVE_INFINITY)) === false. Actual: ' + (!(new Number(Number.NEGATIVE_INFINITY)))); +} + +// CHECK#17 +if (!(new Function()) !== false) { + $ERROR('#17: !(new Function()) === false. Actual: ' + (!(new Function()))); +} + +// CHECK#18 +if (!(new Date()) !== false) { + $ERROR('#18: !(new Date()) === false. Actual: ' + (!(new Date()))); +} + +// CHECK#19 +if (!(new Date(0)) !== false) { + $ERROR('#19: !(new Date(0)) === false. Actual: ' + (!(new Date(0)))); +} + diff --git a/js/src/tests/test262/ch09/9.2/browser.js b/js/src/tests/test262/ch09/9.2/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/browser.js diff --git a/js/src/tests/test262/ch09/9.2/shell.js b/js/src/tests/test262/ch09/9.2/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch09/9.2/shell.js |