Skip to content
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Deprecations:

Language Improvements:

- enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][]
- enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][]
- fix(javascript) prevent `set` keyword conflicting with setTimeout, etc. (#2514) [Vania Kucher][]
- fix(cpp) Fix highlighting of unterminated raw strings (#2261) [David Benjamin][]
- fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][]
- fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][]
Expand All @@ -21,6 +24,7 @@ Language Improvements:
[Josh Goebel]: https://github.com/yyyc514
[Peter Plantinga]: https://github.com/pplantinga
[David Benjamin]: https://github.com/davidben
[Vania Kucher]: https://github.com/qWici


## Version 10.0.1
Expand Down
4 changes: 2 additions & 2 deletions src/languages/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function(hljs) {
'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
'module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect ' +
'Promise'
'Promise setInterval setTimeout clearInterval clearTimeout'
};
var NUMBER = {
className: 'number',
Expand Down Expand Up @@ -263,7 +263,7 @@ export default function(hljs) {
beginKeywords: 'constructor', end: /\{/, excludeEnd: true
},
{
begin:'(get|set)\\s*(?=' + IDENT_RE+ '\\()',
begin: '(get|set)\\s+(?=' + IDENT_RE + '\\()',
end: /{/,
keywords: "get set",
contains: [
Expand Down
3 changes: 2 additions & 1 deletion src/languages/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default function(hljs) {
'TypeError URIError Number Math Date String RegExp Array Float32Array ' +
'Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array ' +
'Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require ' +
'module console window document any number boolean string void Promise'
'module console window document any number boolean string void Promise ' +
'setInterval setTimeout clearInterval clearTimeout'
};
var DECORATOR = {
className: 'meta',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<span class="hljs-built_in">setTimeout</span>();
<span class="hljs-built_in">setInterval</span>();
2 changes: 2 additions & 0 deletions test/markup/javascript/keyword-as-part-of-method-name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setTimeout();
setInterval();