fix corner case with spread syntax (#5572)

This commit is contained in:
Alex Lam S.L
2022-07-22 20:07:04 +01:00
committed by GitHub
parent d67daa8314
commit 56e9454f1f
3 changed files with 80 additions and 44 deletions

View File

@@ -552,16 +552,8 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
function handle_dot() {
next();
var ch = peek();
if (ch == ".") {
var op = ".";
do {
op += ".";
next();
} while (peek() == ".");
return token("operator", op);
}
return is_digit(ch.charCodeAt(0)) ? read_num(".") : token("punc", ".");
if (looking_at("..")) return token("operator", "." + next() + next());
return is_digit(peek().charCodeAt(0)) ? read_num(".") : token("punc", ".");
}
function read_word() {