Highlighter support for JS deprecated.
This commit is contained in:
parent
61237fea68
commit
7d68dc7d04
1 changed files with 6 additions and 0 deletions
|
|
@ -76,6 +76,10 @@ var JavaScriptHighlightRules = function() {
|
|||
// keywords which can be followed by regular expressions
|
||||
var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
|
||||
|
||||
var deprecated = lang.arrayToMap(
|
||||
("__parent__|__count__|escape|unescape|with|__proto__").split("|")
|
||||
);
|
||||
|
||||
var buildinConstants = lang.arrayToMap(
|
||||
("null|Infinity|NaN|undefined").split("|")
|
||||
);
|
||||
|
|
@ -143,6 +147,8 @@ var JavaScriptHighlightRules = function() {
|
|||
token : function(value) {
|
||||
if (globals.hasOwnProperty(value))
|
||||
return "variable.language";
|
||||
else if (deprecated.hasOwnProperty(value))
|
||||
return "invalid.deprecated";
|
||||
else if (keywords.hasOwnProperty(value))
|
||||
return "keyword";
|
||||
else if (buildinConstants.hasOwnProperty(value))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue