From 214c3a9b5d5ab9de4f29c17186e337ef65b19191 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 13 Sep 2013 20:38:20 +0400 Subject: [PATCH] workaround for broken Object.create(null) on old opera fixes https://github.com/ajaxorg/ace-builds/issues/13 --- lib/ace/mode/text_highlight_rules.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ace/mode/text_highlight_rules.js b/lib/ace/mode/text_highlight_rules.js index fc7bfb67..48e016b0 100644 --- a/lib/ace/mode/text_highlight_rules.js +++ b/lib/ace/mode/text_highlight_rules.js @@ -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