diff options
Diffstat (limited to 'js/src/tests/test262/language/white-space')
44 files changed, 764 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/white-space/S7.2_A2.1_T2.js b/js/src/tests/test262/language/white-space/S7.2_A2.1_T2.js new file mode 100644 index 0000000000..a0fd948968 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A2.1_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. + +/*--- +info: HORIZONTAL TAB (U+0009) may occur within strings +es5id: 7.2_A2.1_T2 +description: Use real HORIZONTAL TAB +---*/ + +//CHECK#1 +if (" str ing " !== "\u0009str\u0009ing\u0009") { + $ERROR('#1: " str ing " === "\\u0009str\\u0009ing\\u0009"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A2.2_T2.js b/js/src/tests/test262/language/white-space/S7.2_A2.2_T2.js new file mode 100644 index 0000000000..78d3e67d5f --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A2.2_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. + +/*--- +info: VERTICAL TAB (U+000B) may occur within strings +es5id: 7.2_A2.2_T2 +description: Use real VERTICAL TAB +---*/ + +//CHECK#1 +if ("string" !== "\u000Bstr\u000Bing\u000B") { + $ERROR('#1: "string" === "\\u000Bstr\\u000Bing\\u000B"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A2.3_T2.js b/js/src/tests/test262/language/white-space/S7.2_A2.3_T2.js new file mode 100644 index 0000000000..279a3de9ee --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A2.3_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. + +/*--- +info: FORM FEED (U+000C) may occur within strings +es5id: 7.2_A2.3_T2 +description: Use real FORM FEED +---*/ + +//CHECK#1 +if ("string" !== "\u000Cstr\u000Cing\u000C") { + $ERROR('#1: "string" === "\\u000Cstr\\u000Cing\\u000C"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A2.4_T2.js b/js/src/tests/test262/language/white-space/S7.2_A2.4_T2.js new file mode 100644 index 0000000000..01a7652862 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A2.4_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. + +/*--- +info: SPACE (U+0020) may occur within strings +es5id: 7.2_A2.4_T2 +description: Use real SPACE +---*/ + +//CHECK#1 +if (" str ing " !== "\u0020str\u0020ing\u0020") { + $ERROR('#1: " str ing " === "\\u0020str\\u0020ing\\u0020"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A2.5_T2.js b/js/src/tests/test262/language/white-space/S7.2_A2.5_T2.js new file mode 100644 index 0000000000..7bc27e4527 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A2.5_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. + +/*--- +info: NO-BREAK SPACE (U+00A0) may occur within strings +es5id: 7.2_A2.5_T2 +description: Use real NO-BREAK SPACE +---*/ + +//CHECK#1 +if (" str ing " !== "\u00A0str\u00A0ing\u00A0") { + $ERROR('#1: " str ing " === "\\u00A0str\\u00A0ing\\u00A0"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A3.1_T2.js b/js/src/tests/test262/language/white-space/S7.2_A3.1_T2.js new file mode 100644 index 0000000000..3588e2850e --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A3.1_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Single line comment can contain HORIZONTAL TAB (U+0009) +es5id: 7.2_A3.1_T2 +description: Use real HORIZONTAL TAB +---*/ + +//CHECK#1 +var x = 0; +// single line comment x = 1; +if (x !== 0) { + $ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A3.2_T2.js b/js/src/tests/test262/language/white-space/S7.2_A3.2_T2.js new file mode 100644 index 0000000000..d536e6eeb6 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A3.2_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Single line comment can contain VERTICAL TAB (U+000B) +es5id: 7.2_A3.2_T2 +description: Use real VERTICAL TAB +---*/ + +//CHECK#1 +var x = 0; +//singlelinecommentx = 1; +if (x !== 0) { + $ERROR('#1: var x = 0; //singlelinecommentx = 1; x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A3.3_T2.js b/js/src/tests/test262/language/white-space/S7.2_A3.3_T2.js new file mode 100644 index 0000000000..0dcb0e282b --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A3.3_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Single line comment can contain FORM FEED (U+000C) +es5id: 7.2_A3.3_T2 +description: Use real FORM FEED +---*/ + +//CHECK#1 +var x = 0; +//singlelinecommentx = 1; +if (x !== 0) { + $ERROR('#1: var x = 0; //singlelinecommentx = 1; x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A3.4_T2.js b/js/src/tests/test262/language/white-space/S7.2_A3.4_T2.js new file mode 100644 index 0000000000..7095094e9f --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A3.4_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Single line comment can contain SPACE (U+0020) +es5id: 7.2_A3.4_T2 +description: Use real SPACE +---*/ + +//CHECK#1 +var x = 0; +// single line comment x = 1; +if (x !== 0) { + $ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A3.5_T2.js b/js/src/tests/test262/language/white-space/S7.2_A3.5_T2.js new file mode 100644 index 0000000000..778e79f1d9 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A3.5_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Single line comment can contain NO-BREAK SPACE (U+00A0) +es5id: 7.2_A3.5_T2 +description: Use real NO-BREAK SPACE +---*/ + +//CHECK#1 +var x = 0; +// single line comment x = 1; +if (x !== 0) { + $ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A4.1_T2.js b/js/src/tests/test262/language/white-space/S7.2_A4.1_T2.js new file mode 100644 index 0000000000..38c30493d2 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A4.1_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Multi line comment can contain HORIZONTAL TAB (U+0009) +es5id: 7.2_A4.1_T2 +description: Use real HORIZONTAL TAB +---*/ + +/*CHECK#1*/ +var x = 0; +/* multi line comment x = 1;*/ +if (x !== 0) { + $ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A4.2_T2.js b/js/src/tests/test262/language/white-space/S7.2_A4.2_T2.js new file mode 100644 index 0000000000..95d3615b71 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A4.2_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Multi line comment can contain VERTICAL TAB (U+000B) +es5id: 7.2_A4.2_T2 +description: Use real VERTICAL TAB +---*/ + +/*CHECK#1*/ +var x = 0; +/*multilinecommentx = 1;*/ +if (x !== 0) { + $ERROR('#1: var x = 0; /*multilinecommentx = 1;*/ x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A4.3_T2.js b/js/src/tests/test262/language/white-space/S7.2_A4.3_T2.js new file mode 100644 index 0000000000..7d2ef2da67 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A4.3_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Multi line comment can contain FORM FEED (U+000C) +es5id: 7.2_A4.3_T2 +description: Use real FORM FEED +---*/ + +/*CHECK#1*/ +var x = 0; +/*multilinecommentx = 1;*/ +if (x !== 0) { + $ERROR('#1: var x = 0; /*multilinecommentx = 1;*/ x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A4.4_T2.js b/js/src/tests/test262/language/white-space/S7.2_A4.4_T2.js new file mode 100644 index 0000000000..8875220579 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A4.4_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Multi line comment can contain SPACE (U+0020) +es5id: 7.2_A4.4_T2 +description: Use real SPACE +---*/ + +/*CHECK#1*/ +var x = 0; +/* multi line comment x = 1;*/ +if (x !== 0) { + $ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A4.5_T2.js b/js/src/tests/test262/language/white-space/S7.2_A4.5_T2.js new file mode 100644 index 0000000000..58f008d7ce --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A4.5_T2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Multi line comment can contain NO-BREAK SPACE (U+00A0) +es5id: 7.2_A4.5_T2 +description: Use real NO-BREAK SPACE +---*/ + +/*CHECK#1*/ +var x = 0; +/* multi line comment x = 1;*/ +if (x !== 0) { + $ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/S7.2_A5_T1.js b/js/src/tests/test262/language/white-space/S7.2_A5_T1.js new file mode 100644 index 0000000000..d6cca63c25 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A5_T1.js @@ -0,0 +1,18 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + White space cannot be expressed as a Unicode escape sequence consisting + of six characters, namely \u plus four hexadecimal digits +es5id: 7.2_A5_T1 +description: Use TAB (U+0009) +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var\u0009x; diff --git a/js/src/tests/test262/language/white-space/S7.2_A5_T2.js b/js/src/tests/test262/language/white-space/S7.2_A5_T2.js new file mode 100644 index 0000000000..cdc5627d53 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A5_T2.js @@ -0,0 +1,18 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + White space cannot be expressed as a Unicode escape sequence consisting + of six characters, namely \u plus four hexadecimal digits +es5id: 7.2_A5_T2 +description: Use VERTICAL TAB (U+000B) +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var\u000Bx; diff --git a/js/src/tests/test262/language/white-space/S7.2_A5_T3.js b/js/src/tests/test262/language/white-space/S7.2_A5_T3.js new file mode 100644 index 0000000000..0fe8719d29 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A5_T3.js @@ -0,0 +1,18 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + White space cannot be expressed as a Unicode escape sequence consisting + of six characters, namely \u plus four hexadecimal digits +es5id: 7.2_A5_T3 +description: Use FORM FEED (U+000C) +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var\u000Cx; diff --git a/js/src/tests/test262/language/white-space/S7.2_A5_T4.js b/js/src/tests/test262/language/white-space/S7.2_A5_T4.js new file mode 100644 index 0000000000..c0a348c0da --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A5_T4.js @@ -0,0 +1,18 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + White space cannot be expressed as a Unicode escape sequence consisting + of six characters, namely \u plus four hexadecimal digits +es5id: 7.2_A5_T4 +description: Use SPACE (U+0020) +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var\u0020x; diff --git a/js/src/tests/test262/language/white-space/S7.2_A5_T5.js b/js/src/tests/test262/language/white-space/S7.2_A5_T5.js new file mode 100644 index 0000000000..a214996753 --- /dev/null +++ b/js/src/tests/test262/language/white-space/S7.2_A5_T5.js @@ -0,0 +1,18 @@ +// |reftest| error:SyntaxError +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + White space cannot be expressed as a Unicode escape sequence consisting + of six characters, namely \u plus four hexadecimal digits +es5id: 7.2_A5_T5 +description: Use NO-BREAK SPACE (U+00A0) +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +var\u00A0x; diff --git a/js/src/tests/test262/language/white-space/between-form-feed.js b/js/src/tests/test262/language/white-space/between-form-feed.js new file mode 100644 index 0000000000..43ca67a986 --- /dev/null +++ b/js/src/tests/test262/language/white-space/between-form-feed.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. + +/*--- +info: FORM FEED (U+000C) between any two tokens is allowed +es5id: 7.2_A1.3_T2 +description: Insert real FORM FEED between tokens of var x=1 +---*/ + +varx=1; + +assert.sameValue(x, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/between-horizontal-tab.js b/js/src/tests/test262/language/white-space/between-horizontal-tab.js new file mode 100644 index 0000000000..f73cfbe3fb --- /dev/null +++ b/js/src/tests/test262/language/white-space/between-horizontal-tab.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. + +/*--- +info: HORIZONTAL TAB (U+0009) between any two tokens is allowed +es5id: 7.2_A1.1_T2 +description: Insert real HORIZONTAL TAB between tokens of var x=1 +---*/ + + var x = 1 ; + +assert.sameValue(x, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/between-nbsp.js b/js/src/tests/test262/language/white-space/between-nbsp.js new file mode 100644 index 0000000000..861ac5a5fc --- /dev/null +++ b/js/src/tests/test262/language/white-space/between-nbsp.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. + +/*--- +info: NO-BREAK SPACE (U+00A0) between any two tokens is allowed +es5id: 7.2_A1.5_T2 +description: Insert real NO-BREAK SPACE between tokens of var x=1 +---*/ + + var x = 2 ; + +assert.sameValue(x, 2); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/between-space.js b/js/src/tests/test262/language/white-space/between-space.js new file mode 100644 index 0000000000..25adf422e3 --- /dev/null +++ b/js/src/tests/test262/language/white-space/between-space.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. + +/*--- +info: SPACE (U+0020) between any two tokens is allowed +es5id: 7.2_A1.4_T2 +description: Insert real SPACE between tokens of var x=1 +---*/ + + var x = 2 ; + +assert.sameValue(x, 2); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/between-vertical-tab.js b/js/src/tests/test262/language/white-space/between-vertical-tab.js new file mode 100644 index 0000000000..5591eb62c4 --- /dev/null +++ b/js/src/tests/test262/language/white-space/between-vertical-tab.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. + +/*--- +info: VERTICAL TAB (U+000B) between any two tokens is allowed +es5id: 7.2_A1.2_T2 +description: Insert real VERTICAL TAB between tokens of var x=1 +---*/ + +varx=1; + +assert.sameValue(x, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/browser.js b/js/src/tests/test262/language/white-space/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/white-space/browser.js diff --git a/js/src/tests/test262/language/white-space/comment-multi-form-feed.js b/js/src/tests/test262/language/white-space/comment-multi-form-feed.js new file mode 100644 index 0000000000..f8daa1dce6 --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-multi-form-feed.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. + +/*--- +info: Multi line comment can contain FORM FEED (U+000C) +es5id: 7.2_A4.3_T1 +description: Use FORM FEED(\u000C) +---*/ + +// CHECK#1 +eval("/*\u000C multi line \u000C comment \u000C*/"); + +//CHECK#2 +var x = 0; +eval("/*\u000C multi line \u000C comment \u000C x = 1;*/"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("/*\\u000C multi line \\u000C comment \\u000C x = 1;*/"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-multi-horizontal-tab.js b/js/src/tests/test262/language/white-space/comment-multi-horizontal-tab.js new file mode 100644 index 0000000000..7ac1bd2f28 --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-multi-horizontal-tab.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. + +/*--- +info: Multi line comment can contain HORIZONTAL TAB (U+0009) +es5id: 7.2_A4.1_T1 +description: Use HORIZONTAL TAB(\u0009) +---*/ + +// CHECK#1 +eval("/*\u0009 multi line \u0009 comment \u0009*/"); + +//CHECK#2 +var x = 0; +eval("/*\u0009 multi line \u0009 comment \u0009 x = 1;*/"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("/*\\u0009 multi line \\u0009 comment \\u0009 x = 1;*/"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-multi-nbsp.js b/js/src/tests/test262/language/white-space/comment-multi-nbsp.js new file mode 100644 index 0000000000..7db63e2a30 --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-multi-nbsp.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. + +/*--- +info: Multi line comment can contain NO-BREAK SPACE (U+00A0) +es5id: 7.2_A4.5_T1 +description: Use NO-BREAK SPACE(\u00A0) +---*/ + +// CHECK#1 +eval("/*\u00A0 multi line \u00A0 comment \u00A0*/"); + +//CHECK#2 +var x = 0; +eval("/*\u00A0 multi line \u00A0 comment \u00A0 x = 1;*/"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("/*\\u00A0 multi line \\u00A0 comment \\u00A0 x = 1;*/"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-multi-space.js b/js/src/tests/test262/language/white-space/comment-multi-space.js new file mode 100644 index 0000000000..1c2e5d89b3 --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-multi-space.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. + +/*--- +info: Multi line comment can contain SPACE (U+0020) +es5id: 7.2_A4.4_T1 +description: Use SPACE(\u0020) +---*/ + +// CHECK#1 +eval("/*\u0020 multi line \u0020 comment \u0020*/"); + +//CHECK#2 +var x = 0; +eval("/*\u0020 multi line \u0020 comment \u0020 x = 1;*/"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("/*\\u0020 multi line \\u0020 comment \\u0020 x = 1;*/"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-multi-vertical-tab.js b/js/src/tests/test262/language/white-space/comment-multi-vertical-tab.js new file mode 100644 index 0000000000..c2a9a889f3 --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-multi-vertical-tab.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. + +/*--- +info: Multi line comment can contain VERTICAL TAB (U+000B) +es5id: 7.2_A4.2_T1 +description: Use VERTICAL TAB(\u000B) +---*/ + +// CHECK#1 +eval("/*\u000B multi line \u000B comment \u000B*/"); + +//CHECK#2 +var x = 0; +eval("/*\u000B multi line \u000B comment \u000B x = 1;*/"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("/*\\u000B multi line \\u000B comment \\u000B x = 1;*/"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-single-form-feed.js b/js/src/tests/test262/language/white-space/comment-single-form-feed.js new file mode 100644 index 0000000000..6acff1fa2e --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-single-form-feed.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. + +/*--- +info: Single line comment can contain FORM FEED (U+000C) +es5id: 7.2_A3.3_T1 +description: Use FORM FEED(\u000C) +---*/ + +// CHECK#1 +eval("//\u000C single line \u000C comment \u000C"); + +//CHECK#2 +var x = 0; +eval("//\u000C single line \u000C comment \u000C x = 1;"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("//\\u000C single line \\u000C comment \\u000C x = 1;"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-single-horizontal-tab.js b/js/src/tests/test262/language/white-space/comment-single-horizontal-tab.js new file mode 100644 index 0000000000..594c091f75 --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-single-horizontal-tab.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. + +/*--- +info: Single line comment can contain HORIZONTAL TAB (U+0009) +es5id: 7.2_A3.1_T1 +description: Use HORIZONTAL TAB(\u0009) +---*/ + +// CHECK#1 +eval("//\u0009 single line \u0009 comment \u0009"); + +//CHECK#2 +var x = 0; +eval("//\u0009 single line \u0009 comment \u0009 x = 1;"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("//\\u0009 single line \\u0009 comment \\u0009 x = 1;"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-single-nbsp.js b/js/src/tests/test262/language/white-space/comment-single-nbsp.js new file mode 100644 index 0000000000..613451c9ca --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-single-nbsp.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. + +/*--- +info: Single line comment can contain NO-BREAK SPACE (U+00A0) +es5id: 7.2_A3.5_T1 +description: Use NO-BREAK SPACE(\u00A0) +---*/ + +// CHECK#1 +eval("//\u00A0 single line \u00A0 comment \u00A0"); + +//CHECK#2 +var x = 0; +eval("//\u00A0 single line \u00A0 comment \u00A0 x = 1;"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("//\\u00A0 single line \\u00A0 comment \\u00A0 x = 1;"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-single-space.js b/js/src/tests/test262/language/white-space/comment-single-space.js new file mode 100644 index 0000000000..c14bd05686 --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-single-space.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. + +/*--- +info: Single line comment can contain SPACE (U+0020) +es5id: 7.2_A3.4_T1 +description: Use SPACE(\u0020) +---*/ + +// CHECK#1 +eval("//\u0020 single line \u0020 comment \u0020"); + +//CHECK#2 +var x = 0; +eval("//\u0020 single line \u0020 comment \u0020 x = 1;"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("//\\u0020 single line \\u0020 comment \\u0020 x = 1;"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/comment-single-vertical-tab.js b/js/src/tests/test262/language/white-space/comment-single-vertical-tab.js new file mode 100644 index 0000000000..854fd0820b --- /dev/null +++ b/js/src/tests/test262/language/white-space/comment-single-vertical-tab.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. + +/*--- +info: Single line comment can contain VERTICAL TAB (U+000B) +es5id: 7.2_A3.2_T1 +description: Use VERTICAL TAB(\u000B) +---*/ + +// CHECK#1 +eval("//\u000B single line \u000B comment \u000B"); + +//CHECK#2 +var x = 0; +eval("//\u000B single line \u000B comment \u000B x = 1;"); +if (x !== 0) { + $ERROR('#1: var x = 0; eval("//\\u000B single line \\u000B comment \\u000B x = 1;"); x === 0. Actual: ' + (x)); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/mongolian-vowel-separator-eval.js b/js/src/tests/test262/language/white-space/mongolian-vowel-separator-eval.js new file mode 100644 index 0000000000..5d6914dbeb --- /dev/null +++ b/js/src/tests/test262/language/white-space/mongolian-vowel-separator-eval.js @@ -0,0 +1,31 @@ +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-white-space +description: > + Mongolian Vowel Separator is not recognized as white space (eval code). +info: | + 11.2 White Space + + WhiteSpace :: + <TAB> + <VT> + <FF> + <SP> + <NBSP> + <ZWNBSP> + <USP> + <USP> :: + Other category “Zs” code points + + General Category of U+180E is “Cf” (Format). +features: [u180e] +---*/ + +// U+180E between "var" and "foo". +assert.throws(SyntaxError, function() { + eval("var\u180Efoo;"); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/mongolian-vowel-separator.js b/js/src/tests/test262/language/white-space/mongolian-vowel-separator.js new file mode 100644 index 0000000000..6350dd38c6 --- /dev/null +++ b/js/src/tests/test262/language/white-space/mongolian-vowel-separator.js @@ -0,0 +1,33 @@ +// |reftest| error:SyntaxError +// Copyright (C) 2016 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-white-space +description: > + Mongolian Vowel Separator is not recognized as white space. +info: | + 11.2 White Space + + WhiteSpace :: + <TAB> + <VT> + <FF> + <SP> + <NBSP> + <ZWNBSP> + <USP> + <USP> :: + Other category “Zs” code points + + General Category of U+180E is “Cf” (Format). +negative: + phase: parse + type: SyntaxError +features: [u180e] +---*/ + +$DONOTEVALUATE(); + +// U+180E between "var" and "foo"; UTF8(0x180E) = 0xE1 0xA0 0x8E +varfoo; diff --git a/js/src/tests/test262/language/white-space/shell.js b/js/src/tests/test262/language/white-space/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/white-space/shell.js diff --git a/js/src/tests/test262/language/white-space/string-form-feed.js b/js/src/tests/test262/language/white-space/string-form-feed.js new file mode 100644 index 0000000000..143be4a6d0 --- /dev/null +++ b/js/src/tests/test262/language/white-space/string-form-feed.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. + +/*--- +info: FORM FEED (U+000C) may occur within strings +es5id: 7.2_A2.3_T1 +description: Use FORM FEED(\u000C and \f) +---*/ + +// CHECK#1 +if (eval("'\u000Cstr\u000Cing\u000C'") !== "\u000Cstr\u000Cing\u000C") { + $ERROR('#1: eval("\'\\u000Cstr\\u000Cing\\u000C\'") === "\\u000Cstr\\u000Cing\\u000C"'); +} + +//CHECK#2 +if (eval("'\fstr\fing\f'") !== "\fstr\fing\f") { + $ERROR('#2: eval("\'\\fstr\\fing\\f\'") === "\\fstr\\fing\\f"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/string-horizontal-tab.js b/js/src/tests/test262/language/white-space/string-horizontal-tab.js new file mode 100644 index 0000000000..c983154e83 --- /dev/null +++ b/js/src/tests/test262/language/white-space/string-horizontal-tab.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. + +/*--- +info: HORIZONTAL TAB (U+0009) may occur within strings +es5id: 7.2_A2.1_T1 +description: Use HORIZONTAL TAB(\u0009 and \t) +---*/ + +// CHECK#1 +if (eval("'\u0009str\u0009ing\u0009'") !== "\u0009str\u0009ing\u0009") { + $ERROR('#1: eval("\'\\u0009str\\u0009ing\\u0009\'") === "\\u0009str\\u0009ing\\u0009"'); +} + +//CHECK#2 +if (eval("'\tstr\ting\t'") !== "\tstr\ting\t") { + $ERROR('#2: eval("\'\\tstr\\ting\\t\'") === "\\tstr\\ting\\t"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/string-nbsp.js b/js/src/tests/test262/language/white-space/string-nbsp.js new file mode 100644 index 0000000000..8a43caa320 --- /dev/null +++ b/js/src/tests/test262/language/white-space/string-nbsp.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. + +/*--- +info: NO-BREAK SPACE (U+00A0) may occur within strings +es5id: 7.2_A2.5_T1 +description: Use NO-BREAK SPACE(\u00A0) +---*/ + +// CHECK#1 +if (eval("'\u00A0str\u00A0ing\u00A0'") !== "\u00A0str\u00A0ing\u00A0") { + $ERROR('#1: eval("\'\\u00A0str\\u00A0ing\\u00A0\'") === "\\u00A0str\\u00A0ing\\u00A0"'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/string-space.js b/js/src/tests/test262/language/white-space/string-space.js new file mode 100644 index 0000000000..635fae4df8 --- /dev/null +++ b/js/src/tests/test262/language/white-space/string-space.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. + +/*--- +info: SPACE (U+0020) may occur within strings +es5id: 7.2_A2.4_T1 +description: Use SPACE(\u0020) +---*/ + +// CHECK#1 +if (eval("'\u0020str\u0020ing\u0020'") !== "\u0020str\u0020ing\u0020") { + $ERROR('#1: eval("\'\\u0020str\\u0020ing\\u0020\'") === "\\u0020str\\u0020ing\\u0020"'); +} + +//CHECK#2 +if (eval("' str ing '") !== " str ing ") { + $ERROR('#2: eval("\' str ing \'") === " str ing "'); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/white-space/string-vertical-tab.js b/js/src/tests/test262/language/white-space/string-vertical-tab.js new file mode 100644 index 0000000000..ba376425ed --- /dev/null +++ b/js/src/tests/test262/language/white-space/string-vertical-tab.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. + +/*--- +info: VERTICAL TAB (U+000B) may occur within strings +es5id: 7.2_A2.2_T1 +description: Use VERTICAL TAB(\u000B and \v) +---*/ + +// CHECK#1 +if (eval("'\u000Bstr\u000Bing\u000B'") !== "\u000Bstr\u000Bing\u000B") { + $ERROR('#1: eval("\'\\u000Bstr\\u000Bing\\u000B\'") === "\\u000Bstr\\u000Bing\\u000B"'); +} + +//CHECK#2 +if (eval("'\vstr\ving\v'") !== "\vstr\ving\v") { + $ERROR('#2: eval("\'\\vstr\\ving\\v\'") === "\\vstr\\ving\\v"'); +} + +reportCompare(0, 0); |