Expect early SyntaxError when character range consists of two character classes

This commit is contained in:
André Bargull 2017-09-02 00:28:10 +02:00 committed by Leo Balter
parent f3cd58335f
commit e44d73733b
1 changed files with 1 additions and 6 deletions

View File

@ -10,12 +10,7 @@ features: [regexp-unicode-property-escapes]
---*/
/[\p{Hex}]/u;
assert.throws(
SyntaxError,
() => /[\p{Hex}-\uFFFF]/u,
// See step 1 of https://tc39.github.io/ecma262/#sec-runtime-semantics-characterrange-abstract-operation.
'property escape at start of character class range should throw if it expands to multiple characters'
);
assert.throws.early(SyntaxError, "/[\\p{Hex}-\\uFFFF]/u");
assert.throws.early(SyntaxError, "/[\\p{}]/u");
assert.throws.early(SyntaxError, "/[\\p{invalid}]/u");
assert.throws.early(SyntaxError, "/[\\p{]/u");