Merge pull request #2020 from jugglinmike/refactor-for-parsers-line-terminator

Refactor, reorganize, and extend tests for line terminators
This commit is contained in:
Leo Balter 2019-01-07 11:38:49 -02:00 committed by GitHub
commit 1b524be1c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
47 changed files with 314 additions and 456 deletions

View File

@ -1,15 +0,0 @@
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.3-1
description: >
7.3 - ES5 recognizes the character <LS> (\u2028) as line
terminators when parsing statements
---*/
var test7_3_1, prop;
eval("test7_3_1\u2028prop = 66;");
assert.sameValue(prop, 66, 'prop');
assert.sameValue((typeof test7_3_1), "undefined", '(typeof test7_3_1)');

View File

@ -1,14 +0,0 @@
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.3-10
description: >
7.3 - ES5 recognizes the character <PS> (\u2029) as a
NonEscapeCharacter
---*/
assert.throws(SyntaxError, function() {
eval("var prop = \\u2029;");
});

View File

@ -1,15 +0,0 @@
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.3-2
description: >
7.3 - ES5 recognizes the character <PS> (\u2029) as line
terminators when parsing statements
---*/
var test7_3_2, prop;
eval("test7_3_2\u2029prop = 66;");
assert.sameValue(prop, 66, 'prop');
assert.sameValue((typeof test7_3_2), "undefined", '(typeof test7_3_2)');

View File

@ -1,14 +0,0 @@
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.3-3
description: >
7.3 - ES5 recognizes the character <LS> (\u2028) as terminating
SingleLineComments
---*/
assert.throws(SyntaxError, function() {
eval("//Single Line Comments\u2028 var =;");
});

View File

@ -1,14 +0,0 @@
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.3-4
description: >
7.3 - ES5 recognizes the character <PS> (\u2029) as terminating
SingleLineComments
---*/
assert.throws(SyntaxError, function() {
eval("//Single Line Comments\u2029 var =;");
});

View File

@ -1,14 +0,0 @@
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 7.3-9
description: >
7.3 - ES5 recognizes the character <LS> (\u2028) as a
NonEscapeCharacter
---*/
assert.throws(SyntaxError, function() {
eval("var prop = \\u2028;");
});

View File

@ -1,40 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: LINE FEED (U+000A) may occur between any two tokens
es5id: 7.3_A1.1_T1
description: Insert LINE FEED (\u000A and \n) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u000Avar\u000Ax\u000A=\u000A1\u000A; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u000Avar\\u000Ax\\u000A=\\u000A1\\u000A; result = x;"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u000A" + "var" + "\u000A" + "x" + "\u000A" + "=" + "\u000A" + "2" + "\u000A; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u000A" + "var" + "\\u000A" + "x" + "\\u000A" + "=" + "\\u000A" + "2" + "\\u000A; result = x;"); result === 2. Actual: ' + (result));
}
//CHECK#3
eval("\nvar\nx\n=\n3\n; result = x;");
if (result !== 3) {
$ERROR('#3: eval("\\nvar\\nx\\n=\\n3\\n; result = x;"); result === 3. Actual: ' + (result));
}
//CHECK#4
eval("\n" + "var" + "\n" + "x" + "\n" + "=" + "\n" + "4" + "\n; result = x;");
if (result !== 4) {
$ERROR('#4: eval("\\n" + "var" + "\\n" + "x" + "\\n" + "=" + "\\n" + "4" + "\\n; result = x;"); result === 4. Actual: ' + (result));
}
//CHECK#5
eval("\u000A" + "var" + "\n" + "x" + "\u000A" + "=" + "\n" + "5" + "\u000A; result = x;");
if (result !== 5) {
$ERROR('#5: eval("\\u000A" + "var" + "\\n" + "x" + "\\u000A" + "=" + "\\n" + "5" + "\\u000A; result = x;"); result === 5. Actual: ' + (result));
}

View File

@ -1,40 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: CARRIAGE RETURN (U+000D) may occur between any two tokens
es5id: 7.3_A1.2_T1
description: Insert CARRIAGE RETURN (\u000D and \r) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u000Dvar\u000Dx\u000D=\u000D1\u000D; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u000Dvar\\u000Dx\\u000D=\\u000D1\\u000D"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u000D" + "var" + "\u000D" + "x" + "\u000D" + "=" + "\u000D" + "2" + "\u000D; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u000D" + "var" + "\\u000D" + "x" + "\\u000D" + "=" + "\\u000D" + "2" + "\\u000D"); result === 2. Actual: ' + (result));
}
//CHECK#3
eval("\rvar\rx\r=\r3\r; result = x;");
if (result !== 3) {
$ERROR('#3: eval("\\rvar\\rx\\r=\\r3\\r"); result === 3. Actual: ' + (result));
}
//CHECK#4
eval("\r" + "var" + "\r" + "x" + "\r" + "=" + "\r" + "4" + "\r; result = x;");
if (result !== 4) {
$ERROR('#4: eval("\\r" + "var" + "\\r" + "x" + "\\r" + "=" + "\\r" + "4" + "\\r"); result === 4. Actual: ' + (result));
}
//CHECK#5
eval("\u000D" + "var" + "\r" + "x" + "\u000D" + "=" + "\r" + "5" + "\u000D; result = x;");
if (result !== 5) {
$ERROR('#5: eval("\\u000D" + "var" + "\\r" + "x" + "\\u000D" + "=" + "\\r" + "5" + "\\u000D"); result === 5. Actual: ' + (result));
}

View File

@ -1,22 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: LINE SEPARATOR (U+2028) may occur between any two tokens
es5id: 7.3_A1.3
description: Insert LINE SEPARATOR (\u2028) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u2028var\u2028x\u2028=\u20281\u2028; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u2028var\\u2028x\\u2028=\\u20281\\u2028"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u2028" + "var" + "\u2028" + "x" + "\u2028" + "=" + "\u2028" + "2" + "\u2028; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u2028" + "var" + "\\u2028" + "x" + "\\u2028" + "=" + "\\u2028" + "2" + "\\u2028"); result === 2. Actual: ' + (result));
}

View File

@ -1,22 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: PARAGRAPH SEPARATOR (U+2029) may occur between any two tokens
es5id: 7.3_A1.4
description: Insert PARAGRAPH SEPARATOR (\u2029) between tokens of var x=1
---*/
var result;
// CHECK#1
eval("\u2029var\u2029x\u2029=\u20291\u2029; result = x;");
if (result !== 1) {
$ERROR('#1: eval("\\u2029var\\u2029x\\u2029=\\u20291\\u2029"); result === 1. Actual: ' + (result));
}
//CHECK#2
eval("\u2029" + "var" + "\u2029" + "x" + "\u2029" + "=" + "\u2029" + "2" + "\u2029; result = x;");
if (result !== 2) {
$ERROR('#2: eval("\\u2029" + "var" + "\\u2029" + "x" + "\\u2029" + "=" + "\\u2029" + "2" + "\\u2029"); result === 2. Actual: ' + (result));
}

View File

@ -1,12 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments are terminated by the LINE FEED (U+000A) character
es5id: 7.3_A3.1_T1
description: Insert LINE FEED (\u000A) into single line comment
---*/
assert.throws(Test262Error, function() {
eval("// single line \u000A throw new Test262Error();");
});

View File

@ -1,12 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can not contain LINE FEED (U+000A) inside
es5id: 7.3_A3.1_T2
description: Insert LINE FEED (\u000A) into begin of single line comment
---*/
assert.throws(SyntaxError, function() {
eval("//\u000A single line comment");
});

View File

@ -1,17 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can not contain CARRIAGE RETURN (U+000D) inside
es5id: 7.3_A3.2_T3
description: Insert real CARRIAGE RETURN into single line comment
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
// CHECK#1
//single
line comment

View File

@ -1,12 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can not contain LINE SEPARATOR (U+2028) inside
es5id: 7.3_A3.3_T2
description: Insert LINE SEPARATOR (\u2028) into begin of single line comment
---*/
assert.throws(SyntaxError, function() {
eval("//\u2028 single line comment");
});

View File

@ -1,14 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can not contain PARAGRAPH SEPARATOR (U+2029) inside
es5id: 7.3_A3.4_T2
description: >
Insert PARAGRAPH SEPARATOR (\u2029) into begin of single line
comment
---*/
assert.throws(SyntaxError, function() {
eval("//\u2029 single line comment");
});

View File

@ -1,18 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can contain Line Terminator at the end of line
es5id: 7.3_A4_T1
description: Insert LINE FEED (U+000A) into the end of single line comment
---*/
// CHECK#1
eval("// single line comment\u000A");
// CHECK#2
var x = 0;
eval("// single line comment\u000A x = 1;");
if (x !== 1) {
$ERROR('#1: var x = 0; eval("// single line comment\\u000A x = 1;"); x === 1. Actual: ' + (x));
}

View File

@ -1,18 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can contain Line Terminator at the end of line
es5id: 7.3_A4_T2
description: Insert CARRIAGE RETURN (U+000D) into the end of single line comment
---*/
// CHECK#1
eval("// single line comment\u000D");
// CHECK#2
var x = 0;
eval("// single line comment\u000D x = 1;");
if (x !== 1) {
$ERROR('#1: var x = 0; eval("// single line comment\\u000D x = 1;"); x === 1. Actual: ' + (x));
}

View File

@ -1,18 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can contain Line Terminator at the end of line
es5id: 7.3_A4_T3
description: Insert LINE SEPARATOR (U+2028) into the end of single line comment
---*/
// CHECK#1
eval("// single line comment\u2028");
// CHECK#2
var x = 0;
eval("// single line comment\u2028 x = 1;");
if (x !== 1) {
$ERROR('#1: var x = 0; eval("// single line comment\\u2028 x = 1;"); x === 1. Actual: ' + (x));
}

View File

@ -1,20 +0,0 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can contain Line Terminator at the end of line
es5id: 7.3_A4_T4
description: >
Insert PARAGRAPH SEPARATOR (U+2029) into the end of single line
comment
---*/
// CHECK#1
eval("// single line comment\u2029");
// CHECK#2
var x = 0;
eval("// single line comment\u2029 x = 1;");
if (x !== 1) {
$ERROR('#1: var x = 0; eval("// single line comment\\u2029 x = 1;"); x === 1. Actual: ' + (x));
}

View File

@ -1,18 +0,0 @@
// 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 LINE FEED (U+000A)
es5id: 7.3_A5.1_T1
description: Insert LINE FEED (U+000A) into multi line comment
---*/
// CHECK#1
eval("/*\u000A multi line \u000A comment \u000A*/");
//CHECK#2
var x = 0;
eval("/*\u000A multi line \u000A comment \u000A x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u000A multi line \\u000A comment \\u000A x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -1,20 +0,0 @@
// 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 LINE FEED (U+000A)
es5id: 7.3_A5.1_T2
description: Insert real LINE FEED into multi line comment
---*/
/*CHECK#1*/
var x = 0;
/*
multi
line
comment
x = 1;
*/
if (x !== 0) {
$ERROR('#1: var x = 0; /*\\nmulti\\nline\\ncomment\\nx = 1;\\n*/ x === 0. Actual: ' + (x));
}

View File

@ -1,18 +0,0 @@
// 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 CARRIAGE RETURN (U+000D)
es5id: 7.3_A5.2_T1
description: Insert CARRIAGE RETURN (U+000D) into multi line comment
---*/
// CHECK#1
eval("/*\u000D multi line \u000D comment \u000D*/");
//CHECK#2
var x = 0;
eval("/*\u000D multi line \u000D comment \u000D x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u000D multi line \\u000D comment \\u000D x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -1,18 +0,0 @@
// 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 LINE SEPARATOR (U+2028)
es5id: 7.3_A5.3
description: Insert LINE SEPARATOR (U+2028) into multi line comment
---*/
// CHECK#1
eval("/*\u2028 multi line \u2028 comment \u2028*/");
//CHECK#2
var x = 0;
eval("/*\u2028 multi line \u2028 comment \u2028 x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u2028 multi line \\u2028 comment \\u2028 x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -3,15 +3,13 @@
/*---
info: CARRIAGE RETURN (U+000D) may occur between any two tokens
esid: sec-line-terminators
es5id: 7.3_A1.2_T2
description: Insert real CARRIAGE RETURN between tokens of var x=1
---*/
//CHECK#1
var
x
=
1;
var x = 1;
if (x !== 1) {
$ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x));
}

View File

@ -3,15 +3,14 @@
/*---
info: LINE FEED (U+000A) may occur between any two tokens
esid: sec-line-terminators
es5id: 7.3_A1.1_T2
description: Insert real LINE FEED between tokens of var x=1
---*/
//CHECK#1
var
x
=
1;
if (x !== 1) {
$ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x));
}
assert.sameValue(x, 1);

View File

@ -0,0 +1,13 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: LINE SEPARATOR (U+2028) may occur between any two tokens
esid: sec-line-terminators
es5id: 7.3_A1.3
description: Insert LINE SEPARATOR (\u2028) between tokens of var x=1
---*/
varx=1;
assert.sameValue(x, 1);

View File

@ -0,0 +1,13 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: PARAGRAPH SEPARATOR (U+2029) may occur between any two tokens
esid: sec-line-terminators
es5id: 7.3_A1.4
description: Insert PARAGRAPH SEPARATOR (\u2029) between tokens of var x=1
---*/
varx=1;
assert.sameValue(x, 1);

View File

@ -3,17 +3,14 @@
/*---
info: Multi line comment can contain CARRIAGE RETURN (U+000D)
esid: sec-line-terminators
es5id: 7.3_A5.2_T2
description: Insert real CARRIAGE RETURN into multi line comment
---*/
/*CHECK#1*/
var x = 0;
/*
multi
line
comment
x = 1;
multi line comment x = 1;
*/
if (x !== 0) {
$ERROR('#1: var x = 0; /*\\rmulti\\rline\\rcomment\\rx = 1;\\r*/ x === 0. Actual: ' + (x));

View File

@ -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.
/*---
info: Multi line comment can contain LINE FEED (U+000A)
esid: sec-line-terminators
es5id: 7.3_A5.1_T2
description: Insert real LINE FEED into multi line comment
negative:
phase: runtime
type: Test262Error
---*/
// Because this test concerns the interpretation of non-executable character
// sequences within ECMAScript source code, special care must be taken to
// ensure that executable code is evaluated as expected.
//
// Express the intended behavior by intentionally throwing an error; this
// guarantees that test runners will only consider the test "passing" if
// executable sequences are correctly interpreted as such.
var x = 0;
/*
x = 1;
*/
if (x === 0) {
throw new Test262Error();
}

View File

@ -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.
/*---
info: Multi line comment can contain LINE SEPARATOR (U+2028)
esid: sec-line-terminators
es5id: 7.3_A5.3
description: Insert LINE SEPARATOR (U+2028) into multi line comment
negative:
phase: runtime
type: Test262Error
---*/
// Because this test concerns the interpretation of non-executable character
// sequences within ECMAScript source code, special care must be taken to
// ensure that executable code is evaluated as expected.
//
// Express the intended behavior by intentionally throwing an error; this
// guarantees that test runners will only consider the test "passing" if
// executable sequences are correctly interpreted as such.
var x = 0;
/*x = 1;*/
if (x === 0) {
throw new Test262Error();
}

View File

@ -0,0 +1,28 @@
// Copyright 2019 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Multi line comment can contain PARAGRAPH SEPARATOR (U+2029)
esid: sec-line-terminators
es5id: 7.3_A5.1_T2
description: Insert real PARAGRAPH SEPARATOR into multi line comment
negative:
phase: runtime
type: Test262Error
---*/
// Because this test concerns the interpretation of non-executable character
// sequences within ECMAScript source code, special care must be taken to
// ensure that executable code is evaluated as expected.
//
// Express the intended behavior by intentionally throwing an error; this
// guarantees that test runners will only consider the test "passing" if
// executable sequences are correctly interpreted as such.
var x = 0;
/*x = 1;*/
if (x === 0) {
throw new Test262Error();
}

View File

@ -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.
/*---
info: Single line comments can contain Line Terminator at the end of line
esid: sec-line-terminators
es5id: 7.3_A4_T2
description: Insert CARRIAGE RETURN (U+000D) into the end of single line comment
negative:
phase: runtime
type: Test262Error
---*/
// Because this test concerns the interpretation of non-executable character
// sequences within ECMAScript source code, special care must be taken to
// ensure that executable code is evaluated as expected.
//
// Express the intended behavior by intentionally throwing an error; this
// guarantees that test runners will only consider the test "passing" if
// executable sequences are correctly interpreted as such.
// single line throw new Test262Error();

View File

@ -0,0 +1,23 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments are terminated by the LINE FEED (U+000A) character
esid: sec-line-terminators
es5id: 7.3_A3.1_T1
description: Insert LINE FEED (\u000A) into single line comment
negative:
phase: runtime
type: Test262Error
---*/
// Because this test concerns the interpretation of non-executable character
// sequences within ECMAScript source code, special care must be taken to
// ensure that executable code is evaluated as expected.
//
// Express the intended behavior by intentionally throwing an error; this
// guarantees that test runners will only consider the test "passing" if
// executable sequences are correctly interpreted as such.
// single line
throw new Test262Error();

View File

@ -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.
/*---
info: Single line comments can contain Line Terminator at the end of line
esid: sec-line-terminators
es5id: 7.3_A4_T3
description: Insert LINE SEPARATOR (U+2028) into the end of single line comment
negative:
phase: runtime
type: Test262Error
---*/
// Because this test concerns the interpretation of non-executable character
// sequences within ECMAScript source code, special care must be taken to
// ensure that executable code is evaluated as expected.
//
// Express the intended behavior by intentionally throwing an error; this
// guarantees that test runners will only consider the test "passing" if
// executable sequences are correctly interpreted as such.
// single linethrow new Test262Error();

View File

@ -0,0 +1,24 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: Single line comments can contain Line Terminator at the end of line
esid: sec-line-terminators
es5id: 7.3_A4_T4
description: >
Insert PARAGRAPH SEPARATOR (U+2029) into the end of single line
comment
negative:
phase: runtime
type: Test262Error
---*/
// Because this test concerns the interpretation of non-executable character
// sequences within ECMAScript source code, special care must be taken to
// ensure that executable code is evaluated as expected.
//
// Express the intended behavior by intentionally throwing an error; this
// guarantees that test runners will only consider the test "passing" if
// executable sequences are correctly interpreted as such.
// single linethrow new Test262Error();

View File

@ -4,9 +4,13 @@
/*---
info: Single line comments can not contain CARRIAGE RETURN (U+000D) inside
es5id: 7.3_A3.2_T2
esid: sec-line-terminators
description: Insert CARRIAGE RETURN (\u000D) into begin of single line comment
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval("//\u000D single line comment");
});
$DONOTEVALUATE();
// this text is not included in the single-line comment that precedes it

View File

@ -0,0 +1,17 @@
// Copyright 2019 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-line-terminators
es5id: 7.3-7
description: >
7.3 - ES5 recognizes the character <CR> (\u000D) as terminating
regular expression literals
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
/ /

View File

@ -0,0 +1,18 @@
// Copyright 2019 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-line-terminators
es5id: 7.3-7
description: >
7.3 - ES5 recognizes the character <LF> (\u000A) as terminating
regular expression literals
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
/
/

View File

@ -2,13 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-line-terminators
es5id: 7.3-7
description: >
7.3 - ES5 recognizes the character <LS> (\u2028) as terminating
regular expression literals
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval("var regExp = /[\u2028]/");
});
$DONOTEVALUATE();
//

View File

@ -2,13 +2,16 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-line-terminators
es5id: 7.3-8
description: >
7.3 - ES5 recognizes the character <PS> (\u2029) as terminating
regular expression literals
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval("var regExp = /[\u2029]/");
});
$DONOTEVALUATE();
//

View File

@ -4,9 +4,13 @@
/*---
info: CARRIAGE RETURN (U+000D) within strings is not allowed
es5id: 7.3_A2.2_T1
esid: sec-line-terminators
description: Insert CARRIAGE RETURN (\u000D) into string
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval("'\u000Dstr\u000Ding\u000D'");
});
$DONOTEVALUATE();
' '

View File

@ -4,9 +4,14 @@
/*---
info: LINE FEED (U+000A) within strings is not allowed
es5id: 7.3_A2.1_T1
esid: sec-line-terminators
description: Insert LINE FEED (\u000A) into string
negative:
phase: parse
type: SyntaxError
---*/
assert.throws(SyntaxError, function() {
eval("'\u000Astr\u000Aing\u000A'");
});
$DONOTEVALUATE();
'
'

View File

@ -0,0 +1,16 @@
// Copyright 2019 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: LINE SEPARATOR (U+2028) within strings is not allowed
es5id: 7.3_A2.2_T1
esid: sec-line-terminators
description: Insert LINE SEPARATOR (\u2028) into string
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
''

View File

@ -0,0 +1,16 @@
// Copyright 2019 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: PARAGRAPH SEPARATOR (U+2029) within strings is not allowed
es5id: 7.3_A2.2_T1
esid: sec-line-terminators
description: Insert PARAGRAPH SEPARATOR (\u2029) into string
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
''