mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 7.8.5-1
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
description: >
|
info: |
|
||||||
Literal RegExp Objects - SyntaxError exception is thrown if the
|
RegularExpressionBackslashSequence ::
|
||||||
RegularExpressionNonTerminator position of a
|
\ RegularExpressionNonTerminator
|
||||||
|
|
||||||
|
RegularExpressionNonTerminator ::
|
||||||
|
SourceCharacter but not LineTerminator
|
||||||
|
|
||||||
|
SyntaxError exception is thrown if the RegularExpressionNonTerminator position of a
|
||||||
RegularExpressionBackslashSequence is a LineTerminator.
|
RegularExpressionBackslashSequence is a LineTerminator.
|
||||||
|
description: >
|
||||||
|
A RegularExpressionBackslashSequence may not contain a LineTerminator.
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 7.8.5-1gs
|
esid: prod-RegularExpressionNonTerminator
|
||||||
description: Empty literal RegExp should result in a SyntaxError
|
info: |
|
||||||
negative:
|
RegularExpressionLiteral ::
|
||||||
phase: early
|
/ RegularExpressionBody / RegularExpressionFlags
|
||||||
type: SyntaxError
|
|
||||||
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
info: |
|
||||||
RegularExpressionFirstChar :: NonTerminator but not * or \ or /,
|
RegularExpressionFirstChar :: NonTerminator but not * or \ or /,
|
||||||
RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty]
|
RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty]
|
||||||
es5id: 7.8.5_A1.1_T1
|
es5id: 7.8.5_A1.1_T1
|
||||||
|
@ -2,9 +2,17 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
esid: prod-RegularExpressionFirstChar
|
||||||
es5id: 7.8.5_A1.2_T1
|
info: |
|
||||||
description: "*"
|
RegularExpressionChars ::
|
||||||
|
[empty]
|
||||||
|
RegularExpressionCharsRegularExpressionChar
|
||||||
|
|
||||||
|
RegularExpressionFirstChar ::
|
||||||
|
RegularExpressionNonTerminator but not one of * or \ or / or [
|
||||||
|
|
||||||
|
description: >
|
||||||
|
The first character of a regular expression may not be "*"
|
||||||
negative:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,5 +20,4 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
esid: sec-literals-regular-expression-literals
|
||||||
es5id: 7.8.5_A1.2_T2
|
info: |
|
||||||
description: \
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,5 +23,4 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
esid: sec-literals-regular-expression-literals
|
||||||
es5id: 7.8.5_A1.2_T3
|
info: |
|
||||||
description: /
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +23,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
///
|
///
|
||||||
.source;
|
.source;
|
||||||
|
@ -2,9 +2,20 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: * or \\ or / or [empty] is incorrect"
|
esid: sec-literals-regular-expression-literals
|
||||||
es5id: 7.8.5_A1.2_T4
|
info: |
|
||||||
description: "[empty]"
|
RegularExpressionLiteral::
|
||||||
|
/ RegularExpressionBody / RegularExpressionFlags
|
||||||
|
|
||||||
|
RegularExpressionBody ::
|
||||||
|
RegularExpressionFirstChar RegularExpressionChars
|
||||||
|
|
||||||
|
RegularExpressionChars::
|
||||||
|
[empty]
|
||||||
|
|
||||||
|
MemberExpression . IdentifierName
|
||||||
|
|
||||||
|
description: A regular expression may not be empty.
|
||||||
negative:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +23,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
//
|
//
|
||||||
.source;
|
.source;
|
||||||
|
@ -2,9 +2,23 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A1.3_T1
|
info: |
|
||||||
description: Line Feed, without eval
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +26,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A1.3_T2
|
info: |
|
||||||
description: Line Feed, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,23 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A1.3_T3
|
info: |
|
||||||
description: Carriage Return, without eval
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +26,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A1.3_T4
|
info: |
|
||||||
description: Carriage Return, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,24 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A1.3_T5
|
info: |
|
||||||
description: Line separator, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,23 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionFirstChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A1.3_T6
|
info: |
|
||||||
description: Paragraph separator, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,11 +2,17 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
info: |
|
||||||
incorrect
|
RegularExpressionBackslashSequence ::
|
||||||
es5id: 7.8.5_A1.5_T1
|
\ RegularExpressionNonTerminator
|
||||||
description: Line Feed, without eval
|
|
||||||
|
RegularExpressionNonTerminator ::
|
||||||
|
SourceCharacter but not LineTerminator
|
||||||
|
|
||||||
|
description: >
|
||||||
|
A RegularExpressionBackslashSequence may not contain a <LF>
|
||||||
|
|
||||||
negative:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -14,6 +20,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
info: |
|
||||||
incorrect
|
RegularExpressionBackslashSequence ::
|
||||||
es5id: 7.8.5_A1.5_T2
|
\ RegularExpressionNonTerminator
|
||||||
description: Line Feed, with eval
|
|
||||||
|
RegularExpressionNonTerminator ::
|
||||||
|
SourceCharacter but not LineTerminator
|
||||||
|
|
||||||
|
description: >
|
||||||
|
A RegularExpressionBackslashSequence may not contain a <LF>, evaluated
|
||||||
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
@ -2,11 +2,16 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
info: |
|
||||||
incorrect
|
RegularExpressionBackslashSequence ::
|
||||||
es5id: 7.8.5_A1.5_T3
|
\ RegularExpressionNonTerminator
|
||||||
description: Carriage Return, without eval
|
|
||||||
|
RegularExpressionNonTerminator ::
|
||||||
|
SourceCharacter but not LineTerminator
|
||||||
|
|
||||||
|
description: >
|
||||||
|
A RegularExpressionBackslashSequence may not contain a <CR>
|
||||||
negative:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -14,6 +19,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
info: |
|
||||||
incorrect
|
RegularExpressionBackslashSequence ::
|
||||||
es5id: 7.8.5_A1.5_T4
|
\ RegularExpressionNonTerminator
|
||||||
description: Carriage Return, with eval
|
|
||||||
|
RegularExpressionNonTerminator ::
|
||||||
|
SourceCharacter but not LineTerminator
|
||||||
|
|
||||||
|
description: >
|
||||||
|
A RegularExpressionBackslashSequence may not contain a <CR>, evaluated
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
//CHECK#1
|
||||||
|
@ -2,11 +2,23 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
esid: prod-RegularExpressionNonTerminator
|
||||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
info: |
|
||||||
incorrect
|
RegularExpressionBody ::
|
||||||
es5id: 7.8.5_A1.5_T5
|
RegularExpressionFirstChar RegularExpressionChars
|
||||||
description: Line separator, with eval
|
|
||||||
|
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
|
//CHECK#1
|
||||||
|
@ -2,11 +2,23 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: >
|
esid: prod-RegularExpressionNonTerminator
|
||||||
RegularExpressionFirstChar :: BackslashSequence :: \LineTerminator is
|
info: |
|
||||||
incorrect
|
RegularExpressionBody ::
|
||||||
es5id: 7.8.5_A1.5_T6
|
RegularExpressionFirstChar RegularExpressionChars
|
||||||
description: Paragraph separator, with eval
|
|
||||||
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,17 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: \\ or / is incorrect"
|
esid: prod-RegularExpressionChar
|
||||||
es5id: 7.8.5_A2.2_T1
|
info: |
|
||||||
description: \
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,5 +20,4 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
/a\/
|
/a\/
|
||||||
|
@ -2,9 +2,17 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: \\ or / is incorrect"
|
esid: prod-RegularExpressionChar
|
||||||
es5id: 7.8.5_A2.2_T2
|
info: |
|
||||||
description: /
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,5 +20,4 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
/a//.source;
|
/a//.source;
|
||||||
|
@ -2,9 +2,26 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
esid: sec-literals-regular-expression-literals
|
||||||
es5id: 7.8.5_A2.3_T1
|
info: |
|
||||||
description: Line Feed, without eval
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +29,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
/a
|
/a
|
||||||
/
|
/
|
||||||
|
@ -2,9 +2,26 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
esid: sec-literals-regular-expression-literals
|
||||||
es5id: 7.8.5_A2.3_T2
|
info: |
|
||||||
description: Line Feed, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,27 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
esid: sec-literals-regular-expression-literals
|
||||||
es5id: 7.8.5_A2.3_T3
|
info: |
|
||||||
description: Carriage Return, without eval
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +30,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
/a
|
/a
|
||||||
/
|
/
|
||||||
|
@ -2,9 +2,26 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
esid: sec-literals-regular-expression-literals
|
||||||
es5id: 7.8.5_A2.3_T4
|
info: |
|
||||||
description: Carriage Return, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,24 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A2.3_T5
|
info: |
|
||||||
description: Line separator, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,12 +2,26 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: LineTerminator is incorrect"
|
esid: prod-RegularExpressionNonTerminator
|
||||||
es5id: 7.8.5_A2.3_T6
|
info: |
|
||||||
description: Paragraph separator, with eval
|
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 {
|
try {
|
||||||
eval("/s\u2029/").source;
|
eval("/s\u2029/").source;
|
||||||
$ERROR('#1.1: RegularExpressionChar :: Paragraph separator is incorrect. Actual: ' + (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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
es5id: 7.8.5_A2.5_T1
|
info: |
|
||||||
description: Line Feed, without eval
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +25,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
/a\
|
/a\
|
||||||
/
|
/
|
||||||
|
@ -2,9 +2,22 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
es5id: 7.8.5_A2.5_T2
|
info: |
|
||||||
description: Line Feed, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,22 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
es5id: 7.8.5_A2.5_T3
|
info: |
|
||||||
description: Carriage Return, without eval
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -12,6 +25,5 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
/a\
|
/a\
|
||||||
/
|
/
|
||||||
|
@ -2,9 +2,22 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
es5id: 7.8.5_A2.5_T4
|
info: |
|
||||||
description: Carriage Return, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,22 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
es5id: 7.8.5_A2.5_T5
|
info: |
|
||||||
description: Line separator, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -2,9 +2,22 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
info: "RegularExpressionChar :: BackslashSequence :: \\LineTerminator is incorrect"
|
esid: prod-RegularExpressionBackslashSequence
|
||||||
es5id: 7.8.5_A2.5_T6
|
info: |
|
||||||
description: Paragraph separator, with eval
|
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
|
//CHECK#1
|
||||||
|
@ -10,9 +10,10 @@ es5id: 7.8.5_A4.2
|
|||||||
description: Check equality two regular expression literals
|
description: Check equality two regular expression literals
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//CHECK#1
|
|
||||||
var regexp1 = /(?:)/;
|
var regexp1 = /(?:)/;
|
||||||
var regexp2 = /(?:)/;
|
var regexp2 = /(?:)/;
|
||||||
if (regexp1 === regexp2) {
|
assert.notSameValue(
|
||||||
$ERROR('#1: var regexp1 = /(?:)/; var regexp2 = /(?:)/; regexp1 !== regexp2');
|
regexp1,
|
||||||
}
|
regexp2,
|
||||||
|
"var regexp1 = /(?:)/; var regexp2 = /(?:)/; regexp1 !== regexp2"
|
||||||
|
);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// 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
|
esid: sec-primary-expression-regular-expression-literals-static-semantics-early-errors
|
||||||
info: >
|
info: |
|
||||||
It is a Syntax Error if FlagText of RegularExpressionLiteral contains any
|
PrimaryExpression : RegularExpressionLiteral
|
||||||
code points other than "g", "i", "m", "u", or "y", or if it contains the
|
|
||||||
same code point more than once.
|
description: >
|
||||||
|
It is a Syntax Error if FlagText of RegularExpressionLiteral contains any code points other than "g", "i", "m", "u", or "y", ...
|
||||||
|
|
||||||
negative:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -14,6 +15,4 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
throw new Test262Error();
|
|
||||||
|
|
||||||
/./G;
|
/./G;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// 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
|
esid: sec-primary-expression-regular-expression-literals-static-semantics-early-errors
|
||||||
info: >
|
info: |
|
||||||
It is a Syntax Error if FlagText of RegularExpressionLiteral contains any
|
PrimaryExpression : RegularExpressionLiteral
|
||||||
code points other than "g", "i", "m", "u", or "y", or if it contains the
|
|
||||||
same code point more than once.
|
description: >
|
||||||
|
It is a Syntax Error if FlagText of RegularExpressionLiteral contains ... the same code point more than once.
|
||||||
|
|
||||||
negative:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -14,6 +15,4 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
throw new Test262Error();
|
|
||||||
|
|
||||||
/./gig;
|
/./gig;
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-literals-regular-expression-literals-static-semantics-early-errors
|
esid: sec-literals-regular-expression-literals-static-semantics-early-errors
|
||||||
es6id: 11.8.5.1
|
info: |
|
||||||
description: >
|
RegularExpressionFlags ::
|
||||||
RegularExpressionFlags :: RegularExpressionFlags IdentifierPart
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// 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
|
esid: sec-primary-expression-regular-expression-literals-static-semantics-early-errors
|
||||||
info: >
|
info: |
|
||||||
It is a Syntax Error if BodyText of RegularExpressionLiteral cannot be
|
PrimaryExpression : RegularExpressionLiteral
|
||||||
recognized using the goal symbol Pattern of the ECMAScript RegExp grammar
|
|
||||||
specified in 21.2.1.
|
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:
|
negative:
|
||||||
phase: early
|
phase: early
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
@ -14,6 +14,4 @@ negative:
|
|||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
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.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: sec-regular-expression-literals-runtime-semantics-evaluation
|
esid: sec-regular-expression-literals-runtime-semantics-evaluation
|
||||||
es6id: 12.2.8.2
|
|
||||||
description: Initial state of the `lastIndex` property
|
description: Initial state of the `lastIndex` property
|
||||||
info: |
|
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…
x
Reference in New Issue
Block a user