Skip to content
Snippets Groups Projects
Commit d587abcc authored by Mathias Bynens's avatar Mathias Bynens Committed by Leo Balter
Browse files

Fix test involving a Unicode property escape in a character class range (#1034)

parent a9fa392c
No related branches found
No related tags found
No related merge requests found
...@@ -10,9 +10,11 @@ features: [regexp-unicode-property-escapes] ...@@ -10,9 +10,11 @@ features: [regexp-unicode-property-escapes]
---*/ ---*/
/[\p{Hex}]/u; /[\p{Hex}]/u;
assert( assert.throws(
/[\p{Hex}-\uFFFF]/u.test('-'), SyntaxError,
'property escape in character class should not be parsed as the start of a range' () => /[\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{}]/u"); assert.throws.early(SyntaxError, "/[\\p{}]/u");
assert.throws.early(SyntaxError, "/[\\p{invalid}]/u"); assert.throws.early(SyntaxError, "/[\\p{invalid}]/u");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment