mirror of https://github.com/tc39/test262.git
test/language/literals/regexp/*: early error test fixups (#1276)
This commit is contained in:
parent
e6df79231d
commit
5d4c667b27
|
@ -2,14 +2,28 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 7.8.5-1
|
||||
description: >
|
||||
Literal RegExp Objects - SyntaxError exception is thrown if the
|
||||
RegularExpressionNonTerminator position of a
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
SyntaxError exception is thrown if the RegularExpressionNonTerminator position of a
|
||||
RegularExpressionBackslashSequence is a LineTerminator.
|
||||
description: >
|
||||
A RegularExpressionBackslashSequence may not contain a LineTerminator.
|
||||
---*/
|
||||
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var regExp = /\\\rn/;");
|
||||
eval("/\\\rn/;");
|
||||
/*
|
||||
|
||||
The result of this string is:
|
||||
|
||||
"/\
|
||||
n/;"
|
||||
|
||||
*/
|
||||
});
|
||||
|
|
|
@ -2,13 +2,34 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 7.8.5-1gs
|
||||
description: Empty literal RegExp should result in a SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionLiteral ::
|
||||
/ RegularExpressionBody / RegularExpressionFlags
|
||||
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
SourceCharacter ::
|
||||
any Unicode code point
|
||||
|
||||
RegularExpressionNonTerminator::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
RegularExpressionBody will never be empty, because RegularExpressionFirstChar must always be _something_. // is a comment.
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
var y = 42;
|
||||
var x = //.source;
|
||||
y;
|
||||
|
||||
assert.sameValue(x, y);
|
||||
|
||||
var re = //;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: >
|
||||
info: |
|
||||
RegularExpressionFirstChar :: NonTerminator but not * or \ or /,
|
||||
RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty]
|
||||
es5id: 7.8.5_A1.1_T1
|
||||
|
|
|
@ -2,9 +2,17 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
||||
es5id: 7.8.5_A1.2_T1
|
||||
description: "*"
|
||||
esid: prod-RegularExpressionFirstChar
|
||||
info: |
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionCharsRegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be "*"
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,5 +20,4 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/*/
|
||||
|
|
|
@ -2,9 +2,20 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
||||
es5id: 7.8.5_A1.2_T2
|
||||
description: \
|
||||
esid: sec-literals-regular-expression-literals
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be "\"
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,5 +23,4 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/\/
|
||||
|
|
|
@ -2,9 +2,20 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
||||
es5id: 7.8.5_A1.2_T3
|
||||
description: /
|
||||
esid: sec-literals-regular-expression-literals
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be "/"
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +23,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
///
|
||||
.source;
|
||||
|
|
|
@ -2,9 +2,20 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
||||
es5id: 7.8.5_A1.2_T4
|
||||
description: "[empty]"
|
||||
esid: sec-literals-regular-expression-literals
|
||||
info: |
|
||||
RegularExpressionLiteral::
|
||||
/ RegularExpressionBody / RegularExpressionFlags
|
||||
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars::
|
||||
[empty]
|
||||
|
||||
MemberExpression . IdentifierName
|
||||
|
||||
description: A regular expression may not be empty.
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +23,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
//
|
||||
.source;
|
||||
|
|
|
@ -2,9 +2,23 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A1.3_T1
|
||||
description: Line Feed, without eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <LF> (\u000A)
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +26,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/
|
||||
/
|
||||
|
|
|
@ -2,9 +2,23 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A1.3_T2
|
||||
description: Line Feed, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <LF> (\u000A), evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,23 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A1.3_T3
|
||||
description: Carriage Return, without eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <CR>, (\u000D)
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +26,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/
|
||||
/
|
||||
|
|
|
@ -2,9 +2,23 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A1.3_T4
|
||||
description: Carriage Return, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <CR>, (\u000D), evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,24 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A1.3_T5
|
||||
description: Line separator, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <LS>, (\u2028), evaluated
|
||||
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,23 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A1.3_T6
|
||||
description: Paragraph separator, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <LS>, (\u2028), evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,11 +2,17 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: >
|
||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
||||
incorrect
|
||||
es5id: 7.8.5_A1.5_T1
|
||||
description: Line Feed, without eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A RegularExpressionBackslashSequence may not contain a <LF>
|
||||
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -14,6 +20,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/\
|
||||
/
|
||||
|
|
|
@ -2,11 +2,17 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: >
|
||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
||||
incorrect
|
||||
es5id: 7.8.5_A1.5_T2
|
||||
description: Line Feed, with eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A RegularExpressionBackslashSequence may not contain a <LF>, evaluated
|
||||
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,11 +2,16 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: >
|
||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
||||
incorrect
|
||||
es5id: 7.8.5_A1.5_T3
|
||||
description: Carriage Return, without eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A RegularExpressionBackslashSequence may not contain a <CR>
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -14,6 +19,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/\
|
||||
/
|
||||
|
|
|
@ -2,11 +2,16 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: >
|
||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
||||
incorrect
|
||||
es5id: 7.8.5_A1.5_T4
|
||||
description: Carriage Return, with eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A RegularExpressionBackslashSequence may not contain a <CR>, evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,11 +2,23 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: >
|
||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
||||
incorrect
|
||||
es5id: 7.8.5_A1.5_T5
|
||||
description: Line separator, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <LS>, (\u2028), evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,11 +2,23 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: >
|
||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
||||
incorrect
|
||||
es5id: 7.8.5_A1.5_T6
|
||||
description: Paragraph separator, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <PS>, (\u2029), evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,17 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: \\ or / is incorrect"
|
||||
es5id: 7.8.5_A2.2_T1
|
||||
description: \
|
||||
esid: prod-RegularExpressionChar
|
||||
info: |
|
||||
RegularExpressionChar ::
|
||||
RegularExpressionNonTerminator but not one of \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A regular express may not contain a "\" as a SourceCharacter
|
||||
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,5 +20,4 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/a\/
|
||||
|
|
|
@ -2,9 +2,17 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: \\ or / is incorrect"
|
||||
es5id: 7.8.5_A2.2_T2
|
||||
description: /
|
||||
esid: prod-RegularExpressionChar
|
||||
info: |
|
||||
RegularExpressionChar ::
|
||||
RegularExpressionNonTerminator but not one of \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a "/" as a SourceCharacter
|
||||
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,5 +20,4 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/a//.source;
|
||||
|
|
|
@ -2,9 +2,26 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.3_T1
|
||||
description: Line Feed, without eval
|
||||
esid: sec-literals-regular-expression-literals
|
||||
info: |
|
||||
RegularExpressionChar ::
|
||||
RegularExpressionBackslashSequence
|
||||
|
||||
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LF> as a SourceCharacter
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +29,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/a
|
||||
/
|
||||
|
|
|
@ -2,9 +2,26 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.3_T2
|
||||
description: Line Feed, with eval
|
||||
esid: sec-literals-regular-expression-literals
|
||||
info: |
|
||||
RegularExpressionChar ::
|
||||
RegularExpressionBackslashSequence
|
||||
|
||||
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LF> as a SourceCharacter, evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,27 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.3_T3
|
||||
description: Carriage Return, without eval
|
||||
esid: sec-literals-regular-expression-literals
|
||||
info: |
|
||||
RegularExpressionChar ::
|
||||
RegularExpressionBackslashSequence
|
||||
|
||||
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <CR> as a SourceCharacter
|
||||
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +30,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/a
|
||||
/
|
||||
|
|
|
@ -2,9 +2,26 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.3_T4
|
||||
description: Carriage Return, with eval
|
||||
esid: sec-literals-regular-expression-literals
|
||||
info: |
|
||||
RegularExpressionChar ::
|
||||
RegularExpressionBackslashSequence
|
||||
|
||||
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <CR> as a SourceCharacter, evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,24 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.3_T5
|
||||
description: Line separator, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LS> as a SourceCharacter, evaluated
|
||||
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,12 +2,26 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.3_T6
|
||||
description: Paragraph separator, with eval
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <PS> as a SourceCharacter, evaluated
|
||||
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
try {
|
||||
eval("/s\u2029/").source;
|
||||
$ERROR('#1.1: RegularExpressionChar :: Paragraph separator is incorrect. Actual: ' + (eval("/s\u2029/").source));
|
||||
|
|
|
@ -2,9 +2,22 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.5_T1
|
||||
description: Line Feed, without eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LF> as a SourceCharacter
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +25,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/a\
|
||||
/
|
||||
|
|
|
@ -2,9 +2,22 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.5_T2
|
||||
description: Line Feed, with eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LF> as a SourceCharacter, evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,22 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.5_T3
|
||||
description: Carriage Return, without eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <CR> as a SourceCharacter
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -12,6 +25,5 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
//CHECK#1
|
||||
/a\
|
||||
/
|
||||
|
|
|
@ -2,9 +2,22 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.5_T4
|
||||
description: Carriage Return, with eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LF> as a SourceCharacter, evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,22 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.5_T5
|
||||
description: Line separator, with eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LS> as a SourceCharacter, evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -2,9 +2,22 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
||||
es5id: 7.8.5_A2.5_T6
|
||||
description: Paragraph separator, with eval
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <PS> as a SourceCharacter, evaluated
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
|
|
|
@ -10,9 +10,10 @@ es5id: 7.8.5_A4.2
|
|||
description: Check equality two regular expression literals
|
||||
---*/
|
||||
|
||||
//CHECK#1
|
||||
var regexp1 = /(?:)/;
|
||||
var regexp2 = /(?:)/;
|
||||
if (regexp1 === regexp2) {
|
||||
$ERROR('#1: var regexp1 = /(?:)/; var regexp2 = /(?:)/; regexp1 !== regexp2');
|
||||
}
|
||||
assert.notSameValue(
|
||||
regexp1,
|
||||
regexp2,
|
||||
"var regexp1 = /(?:)/; var regexp2 = /(?:)/; regexp1 !== regexp2"
|
||||
);
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Literal may not contain an unrecognized flag (early error)
|
||||
esid: sec-primary-expression-regular-expression-literals-static-semantics-early-errors
|
||||
info: >
|
||||
It is a Syntax Error if FlagText of RegularExpressionLiteral contains any
|
||||
code points other than "g", "i", "m", "u", or "y", or if it contains the
|
||||
same code point more than once.
|
||||
info: |
|
||||
PrimaryExpression : RegularExpressionLiteral
|
||||
|
||||
description: >
|
||||
It is a Syntax Error if FlagText of RegularExpressionLiteral contains any code points other than "g", "i", "m", "u", or "y", ...
|
||||
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -14,6 +15,4 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
throw new Test262Error();
|
||||
|
||||
/./G;
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Literal may not contain duplicate flags (early error)
|
||||
esid: sec-primary-expression-regular-expression-literals-static-semantics-early-errors
|
||||
info: >
|
||||
It is a Syntax Error if FlagText of RegularExpressionLiteral contains any
|
||||
code points other than "g", "i", "m", "u", or "y", or if it contains the
|
||||
same code point more than once.
|
||||
info: |
|
||||
PrimaryExpression : RegularExpressionLiteral
|
||||
|
||||
description: >
|
||||
It is a Syntax Error if FlagText of RegularExpressionLiteral contains ... the same code point more than once.
|
||||
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -14,6 +15,4 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
throw new Test262Error();
|
||||
|
||||
/./gig;
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-literals-regular-expression-literals-static-semantics-early-errors
|
||||
es6id: 11.8.5.1
|
||||
description: >
|
||||
RegularExpressionFlags :: RegularExpressionFlags IdentifierPart
|
||||
info: |
|
||||
RegularExpressionFlags ::
|
||||
RegularExpressionFlags IdentifierPart
|
||||
|
||||
- It is a Syntax Error if IdentifierPart contains a Unicode escape sequence.
|
||||
description: >
|
||||
It is a Syntax Error if IdentifierPart contains a Unicode escape sequence.
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: Literal may not describe an invalid pattern (early error)
|
||||
esid: sec-primary-expression-regular-expression-literals-static-semantics-early-errors
|
||||
info: >
|
||||
It is a Syntax Error if BodyText of RegularExpressionLiteral cannot be
|
||||
recognized using the goal symbol Pattern of the ECMAScript RegExp grammar
|
||||
specified in 21.2.1.
|
||||
info: |
|
||||
PrimaryExpression : RegularExpressionLiteral
|
||||
|
||||
description: >
|
||||
It is a Syntax Error if BodyText of RegularExpressionLiteral cannot be recognized using the goal symbol Pattern of the ECMAScript RegExp grammar specified in #sec-patterns.
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
|
@ -14,6 +14,4 @@ negative:
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
throw new Test262Error();
|
||||
|
||||
/?/;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-regular-expression-literals-runtime-semantics-evaluation
|
||||
es6id: 12.2.8.2
|
||||
description: Initial state of the `lastIndex` property
|
||||
info: |
|
||||
[...]
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <LS>
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
/
/
|
||||
|
||||
/*
|
||||
There is a <LS> between the two / characters
|
||||
*/
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
The first character of a regular expression may not be a <PS>
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
/
/
|
||||
|
||||
/*
|
||||
There is a <PS> between the two / characters
|
||||
*/
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: prod-RegularExpressionBackslashSequence
|
||||
info: |
|
||||
RegularExpressionBackslashSequence ::
|
||||
\ RegularExpressionNonTerminator
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
LineTerminator ::
|
||||
<LF>
|
||||
<CR>
|
||||
<LS>
|
||||
<PS>
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <LS> as a SourceCharacter
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
/a\\
/
|
||||
|
||||
/*
|
||||
There is a <LS> between "a\\
" and "/"
|
||||
*/
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright 2009 the Sputnik authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: prod-RegularExpressionNonTerminator
|
||||
info: |
|
||||
RegularExpressionBody ::
|
||||
RegularExpressionFirstChar RegularExpressionChars
|
||||
|
||||
RegularExpressionChars ::
|
||||
[empty]
|
||||
RegularExpressionChars RegularExpressionChar
|
||||
|
||||
RegularExpressionFirstChar ::
|
||||
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||
|
||||
RegularExpressionNonTerminator ::
|
||||
SourceCharacter but not LineTerminator
|
||||
|
||||
description: >
|
||||
A regular expression may not contain a <PS> as a SourceCharacter
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
/a\\
/
|
||||
|
||||
/*
|
||||
There is a <PS> between "a\\
" and "/"
|
||||
*/
|
Loading…
Reference in New Issue