oj
oj copied to clipboard
Support `use strict`: Change with(oj) to oj.extendInto(this)
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/with
Many scripts and libraries use "use strict";
. In order to not run into complications, OJ probably should extend into the scope that it wants to. In the case of a rendering sequence:
(function(){try{ oj.extendInto(this); (function(){
h1("Foo bar");
}).apply(this);}catch(e){ handle_error(e); }})();
Just a thought, since I just read the article.
This is a great idea, thank you! In addition to this, there are a couple secret things that OJ does that may not be compatible with use strict, for example the way OJ creates dynamic prototypes is pretty fancy :). That said, I think it's a worthy goal that OJ v2.0 supports use strict. Let's do this!