diff options
Diffstat (limited to 'js/src/tests/test262/ch11/11.4/11.4.2')
11 files changed, 237 insertions, 0 deletions
diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A1.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A1.js new file mode 100644 index 000000000..6211fc242 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_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 "void" and UnaryExpression are allowed + * + * @path ch11/11.4/11.4.2/S11.4.2_A1.js + * @description Checking by using eval + */ + +//CHECK#1 +if (eval("void\u00090") !== undefined) { + $ERROR('#1: void\\u00090 === undefined'); +} + +//CHECK#2 +if (eval("void\u000B0") !== undefined) { + $ERROR('#2: void\\u000B0 === undefined'); +} + +//CHECK#3 +if (eval("void\u000C0") !== undefined) { + $ERROR('#3: void\\u000C0 === undefined'); +} + +//CHECK#4 +if (eval("void\u00200") !== undefined) { + $ERROR('#4: void\\u00200 === undefined'); +} + +//CHECK#5 +if (eval("void\u00A00") !== undefined) { + $ERROR('#5: void\\u00A00 === undefined'); +} + +//CHECK#6 +if (eval("void\u000A0") !== undefined) { + $ERROR('#6: void\\u000A0 === undefined'); +} + +//CHECK#7 +if (eval("void\u000D0") !== undefined) { + $ERROR('#7: void\\u000D0 === undefined'); +} + +//CHECK#8 +if (eval("void\u20280") !== undefined) { + $ERROR('#8: void\\u20280 === undefined'); +} + +//CHECK#9 +if (eval("void\u20290") !== undefined) { + $ERROR('#9: void\\u20290 === undefined'); +} + +//CHECK#10 +if (eval("void\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u20290") !== undefined) { + $ERROR('#10: void\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u20290 === undefined'); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A2_T1.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A2_T1.js new file mode 100644 index 000000000..bb2ba2a9d --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" uses GetValue + * + * @path ch11/11.4/11.4.2/S11.4.2_A2_T1.js + * @description Either Type(x) is not Reference or GetBase(x) is not null + */ + +//CHECK#1 +if (void 0 !== undefined) { + $ERROR('#1: void 0 === undefined. Actual: ' + (void 0)); +} + +//CHECK#2 +var x = 0; +if (void x !== undefined) { + $ERROR('#2: var x = 0; void x === undefined. Actual: ' + (void x)); +} + +//CHECK#3 +var x = new Object(); +if (void x !== undefined) { + $ERROR('#3: var x = new Object(); void x === undefined. Actual: ' + (void x)); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A2_T2.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A2_T2.js new file mode 100644 index 000000000..a6074837a --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" uses GetValue + * + * @path ch11/11.4/11.4.2/S11.4.2_A2_T2.js + * @description If GetBase(x) is null, throw ReferenceError + * @negative + */ + +//CHECK#1 +void x; + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T1.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T1.js new file mode 100644 index 000000000..169eeb6c8 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" evaluates UnaryExpression and returns undefined + * + * @path ch11/11.4/11.4.2/S11.4.2_A4_T1.js + * @description Type(x) is boolean primitive or Boolean object + */ + +//CHECK#1 +var x = false; +if (void x !== undefined) { + $ERROR('#1: var x = false; void x === undefined. Actual: ' + (void x)); +} + +//CHECK#2 +var x = new Boolean(true); +if (void x !== undefined) { + $ERROR('#2: var x = new Boolean(true); void x === undefined. Actual: ' + (void x)); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T2.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T2.js new file mode 100644 index 000000000..0175474af --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" evaluates UnaryExpression and returns undefined + * + * @path ch11/11.4/11.4.2/S11.4.2_A4_T2.js + * @description Type(x) is number primitive or Number object + */ + +//CHECK#1 +var x = 0.1; +if (void x !== undefined) { + $ERROR('#1: var x = 0.1; void x === undefined. Actual: ' + (void x)); +} + +//CHECK#2 +var x = new Number(-1.1); +if (void x !== undefined) { + $ERROR('#2: var x = new Number(-1.1); void x === undefined. Actual: ' + (void x)); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T3.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T3.js new file mode 100644 index 000000000..884b84af4 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" evaluates UnaryExpression and returns undefined + * + * @path ch11/11.4/11.4.2/S11.4.2_A4_T3.js + * @description Type(x) is string primitive of String object + */ + +//CHECK#1 +var x = "1"; +if (void x !== undefined) { + $ERROR('#1: var x = "1"; void x === undefined. Actual: ' + (void x)); +} + +//CHECK#2 +var x = "x"; +if (isNaN(void x) !== true) { + $ERROR('#2: var x = "x"; void x === undefined. Actual: ' + (void x)); +} + +//CHECK#3 +var x = new String("-1"); +if (void x !== undefined) { + $ERROR('#3: var x = new String("-1"); void x === undefined. Actual: ' + (void x)); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T4.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T4.js new file mode 100644 index 000000000..d6da81854 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" evaluates UnaryExpression and returns undefined + * + * @path ch11/11.4/11.4.2/S11.4.2_A4_T4.js + * @description Type(x) is undefined or null + */ + +//CHECK#1 +var x; +if (isNaN(void x) !== true) { + $ERROR('#1: var x; void x === undefined. Actual: ' + (void x)); +} + +//CHECK#2 +var x = null; +if (void x !== undefined) { + $ERROR('#2: var x = null; void x === undefined. Actual: ' + (void x)); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T5.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T5.js new file mode 100644 index 000000000..2be1def15 --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" evaluates UnaryExpression and returns undefined + * + * @path ch11/11.4/11.4.2/S11.4.2_A4_T5.js + * @description Type(x) is Object object or Function object + */ + +//CHECK#1 +var x = {}; +if (isNaN(void x) !== true) { + $ERROR('#1: var x = {}; void x === undefined. Actual: ' + (void x)); +} + +//CHECK#2 +var x = function(){return 1}; +if (isNaN(void x) !== true) { + $ERROR('#2: var x = function(){return 1}; void x === undefined. Actual: ' + (void x)); +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T6.js b/js/src/tests/test262/ch11/11.4/11.4.2/S11.4.2_A4_T6.js new file mode 100644 index 000000000..40c184cbe --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/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. + +/** + * Operator "void" evaluates UnaryExpression and returns undefined + * + * @path ch11/11.4/11.4.2/S11.4.2_A4_T6.js + * @description Checking Simple Assignment operator + */ + +//CHECK#1 +var x = 0; +if (void (x = 1) !== undefined) { + $ERROR('#1: var x = 0; void (x = 1) === undefined. Actual: ' + (void (x = 1))); +} else { + if (x !== 1) { + $ERROR('#1: var x = 0; void (x = 1); x === 1. Actual: ' + (x)); + } +} + diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/browser.js b/js/src/tests/test262/ch11/11.4/11.4.2/browser.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/browser.js diff --git a/js/src/tests/test262/ch11/11.4/11.4.2/shell.js b/js/src/tests/test262/ch11/11.4/11.4.2/shell.js new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/js/src/tests/test262/ch11/11.4/11.4.2/shell.js |