diff --git a/test/language/literals/regexp/early-err-bad-flag.js b/test/language/literals/regexp/early-err-bad-flag.js new file mode 100644 index 0000000000000000000000000000000000000000..72842c41a25f8b1a8906e065c906c1e8edbfd4ad --- /dev/null +++ b/test/language/literals/regexp/early-err-bad-flag.js @@ -0,0 +1,15 @@ +// 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. +negative: SyntaxError +---*/ + +throw new Test262Error(); + +/./G; diff --git a/test/language/literals/regexp/early-err-dup-flag.js b/test/language/literals/regexp/early-err-dup-flag.js new file mode 100644 index 0000000000000000000000000000000000000000..266fff009dca96e1f3c212ee0930b421b9518f7d --- /dev/null +++ b/test/language/literals/regexp/early-err-dup-flag.js @@ -0,0 +1,15 @@ +// 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. +negative: SyntaxError +---*/ + +throw new Test262Error(); + +/./gig; diff --git a/test/language/literals/regexp/early-err-pattern.js b/test/language/literals/regexp/early-err-pattern.js new file mode 100644 index 0000000000000000000000000000000000000000..bdea79346afefd4da129d5c9af1fe6de1b9ab277 --- /dev/null +++ b/test/language/literals/regexp/early-err-pattern.js @@ -0,0 +1,15 @@ +// 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. +negative: SyntaxError +---*/ + +throw new Test262Error(); + +/?/;