Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ New Grammars:

Core Grammars:

- fix(javascript) correctly highlight 'for await' again [wolfgang42][]
- enh(csp) add missing directives / keywords from MDN (7 more) [Max Liashuk][]
- enh(ada) add new `parallel` keyword, allow `[]` for Ada 2022 [Max Reznik][]

Expand Down
3 changes: 2 additions & 1 deletion src/languages/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ export default function(hljs) {
noneOf([
...ECMAScript.BUILT_IN_GLOBALS,
"super",
"import"
"import",
"await",
].map(x => `${x}\\s*\\(`)),
IDENT_RE, regex.lookahead(/\s*\(/)),
className: "title.function",
Expand Down
3 changes: 3 additions & 0 deletions test/markup/javascript/keywords.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
<span class="hljs-keyword">return</span> <span class="hljs-regexp">/\d+[\s/]/g</span>;
}
<span class="hljs-keyword">using</span> val = <span class="hljs-title function_">condition</span>();
<span class="hljs-keyword">for</span> <span class="hljs-keyword">await</span> (<span class="hljs-keyword">const</span> item <span class="hljs-keyword">of</span> items) {
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(item);
}
}
3 changes: 3 additions & 0 deletions test/markup/javascript/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ function $initHighlight(block, cls) {
return /\d+[\s/]/g;
}
using val = condition();
for await (const item of items) {
console.log(item);
}
}