diff --git a/index.js b/index.js index cc8fe11..4515830 100644 --- a/index.js +++ b/index.js @@ -1019,7 +1019,8 @@ Lexer.prototype = { if (!whitespaceRe.test(str[x])) { // if it is a JavaScript punctuator, then assume that it is // a part of the value - return !characterParser.isPunctuator(str[x]) || quoteRe.test(str[x]); + // also make exception for spread syntax + return /^\.\.\./.test(str.slice(x)) || !characterParser.isPunctuator(str[x]) || quoteRe.test(str[x]); } } }