Skip to content

Commit

Permalink
Ban octal escapes in v mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Dec 14, 2021
1 parent 0655578 commit 15cf7a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@
}

function bailOctalEscapeIfUnicode(from, pos) {
if (hasUnicodeFlag) {
if (hasUnicodeFlag || hasUnicodeSetFlag) {
bail("Invalid decimal escape in unicode mode", null, from, pos);
}
}
Expand Down
6 changes: 6 additions & 0 deletions test/test-data-unicode-set.json
Original file line number Diff line number Diff line change
Expand Up @@ -1493,5 +1493,11 @@
9
],
"raw": "[^\\q{AB}]"
},
"\\1": {
"type": "error",
"name": "SyntaxError",
"message": "Invalid decimal escape in unicode mode at position 1\n \\1\n ^",
"input": "\\1"
}
}

0 comments on commit 15cf7a5

Please sign in to comment.