Skip to content

Support use strict: Change with(oj) to oj.extendInto(this) #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
IngwiePhoenix opened this issue May 3, 2015 · 1 comment
Open

Comments

@IngwiePhoenix
Copy link

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.

@evanmoran
Copy link
Owner

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!

@evanmoran evanmoran changed the title Change with(oj) to oj.extendInto(this) Support Use Strict: Change with(oj) to oj.extendInto(this) Dec 30, 2017
@evanmoran evanmoran changed the title Support Use Strict: Change with(oj) to oj.extendInto(this) Support use strict: Change with(oj) to oj.extendInto(this) Dec 30, 2017
@evanmoran evanmoran reopened this Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants