Code Mirror assigns incorrect class to alert() and .match() keywords

I was trying to create a custom code mirror theme where all user defined keywords (variable names, function names, object properties, etc) were one color. This is to help people new to JS, who do not know what is javascript word they must memorize, and what is not.00

But, I am having trouble accomplishing this goal because

When you write :

alert(); then alert will be styled with to cm-variable. But, alert is not a variable.

When you write:

var res = /(.*?)/g.match(bar);

.match is being styled as cm-property, but it is not a property.

Does anyone have an idea how to fix?

Thanks!

Alert is absolutely a variable in JavaScript. Similarly, the match property on a regexp is a property. As such, the styling is intentional.

My apologies, I did not know this. Thanks for the reply!!

Tim