workaround for broken Object.create(null) on old opera

fixes https://github.com/ajaxorg/ace-builds/issues/13
This commit is contained in:
nightwing 2013-09-13 20:38:20 +04:00
commit 214c3a9b5d

View file

@ -212,6 +212,11 @@ var TextHighlightRules = function() {
for (var i = list.length; i--; )
keywords[list[i]] = className;
});
// in old versions of opera keywords["__proto__"] sets prototype
// even on objects with __proto__=null
if (Object.getPrototypeOf(keywords)) {
keywords.__proto__ = null;
}
this.$keywordList = Object.keys(keywords);
map = null;
return ignoreCase