Skip to content
Snippets Groups Projects
Commit 14c07d51 authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[mllike mode] Fix bad usage of object as dictionary

Looking up arbitrary strings without a hasOwnProperty check
never ends well.

Closes #3106
parent cd6a1a72
No related merge requests found
......@@ -85,7 +85,7 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
}
stream.eatWhile(/\w/);
var cur = stream.current();
return words[cur] || 'variable';
return words.hasOwnProperty(cur) ? words[cur] : 'variable';
}
function tokenString(stream, state) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment