binaryage / firerainbow

Javascript syntax highlighting for Firebug

Home Page:http://firerainbow.binaryage.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reduce clutter/conflict

altblue opened this issue · comments

I noticed that various extensions tend to break when enabling FireRainbow, all because of the global functions defined in codemirror/util.js (map, forEach, etc). (Almost) none of them are in fact used, so that file can be reduced to:

// The value used to signal the end of a sequence in iterators.
var StopIteration = {toString: function() {return "StopIteration"}};

// Create a predicate function that tests a string againsts a given
// regular expression.
function matcher(regexp){
  return function(value){return regexp.test(value);};
}

good point!

i've taken codemirror as it is without further sandboxing (that made my life easier when updating codemirror sources)

in the future I plan to move whole codemirror into firefox javascript worker, so it will live in it's own sandbox.

but anyway in the time between we can clear some of these unused global variables, thanks for bringing it up