diff --git a/test/built-ins/RegExp/property-escapes/character-class.js b/test/built-ins/RegExp/property-escapes/character-class.js index d2bcd7310c..bb09e9c818 100644 --- a/test/built-ins/RegExp/property-escapes/character-class.js +++ b/test/built-ins/RegExp/property-escapes/character-class.js @@ -10,9 +10,11 @@ features: [regexp-unicode-property-escapes] ---*/ /[\p{Hex}]/u; -assert( - /[\p{Hex}-\uFFFF]/u.test('-'), - 'property escape in character class should not be parsed as the start of a range' +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{}]/u"); assert.throws.early(SyntaxError, "/[\\p{invalid}]/u");