-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS: Added support for keywords after a spread operator (#2148)
This PR fixes that keywords after a spread operator weren't highlighted. This is mainly for the `await` and `new` keywords.
- Loading branch information
1 parent
a06aca0
commit 1f3f892
Showing
4 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tests/languages/javascript/spread_and_keyword_feature.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
async function bar() { | ||
return [...await foo()] | ||
} | ||
|
||
console.log([...new Set(numbers)]) | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "async"], | ||
["keyword", "function"], | ||
["function", "bar"], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", "{"], | ||
["keyword", "return"], | ||
["punctuation", "["], | ||
["operator", "..."], | ||
["keyword", "await"], | ||
["function", "foo"], | ||
["punctuation", "("], | ||
["punctuation", ")"], | ||
["punctuation", "]"], | ||
["punctuation", "}"], | ||
|
||
"\r\n\r\nconsole", | ||
["punctuation", "."], | ||
["function", "log"], | ||
["punctuation", "("], | ||
["punctuation", "["], | ||
["operator", "..."], | ||
["keyword", "new"], | ||
["class-name", [ | ||
"Set" | ||
]], | ||
["punctuation", "("], | ||
"numbers", | ||
["punctuation", ")"], | ||
["punctuation", "]"], | ||
["punctuation", ")"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for the spread operator followed by a keyword. |