-
Notifications
You must be signed in to change notification settings - Fork 111
support being evaluated with "use strict" prefixed #107
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
base: master
Are you sure you want to change the base?
Conversation
Fixes use case:
var build = new Function('module', '"use strict";\n' + <string contents of /src/bean.js>);
var bean = {exports:{}};
build.call(window, [bean]);
bean = bean.exports;
This use case is a minimal working example extracted from my custom module loader for the browser (think of yet another browserify).
|
Sorry, I'm not going to add any more crazy to this crazy boilerplate, I'm tempted enough to pull out AMD support as it is. Perhaps you can write a wrapper that does what you need instead? |
|
In strict mode I could write a wrapper just for bean, but bean is the only module among dozens of others I load that would need a special wrapper. I don't need to touch AMD support. Making only this change accfc72 fixes the issue - I just evaluate that code with |
|
@ded help! I get pain in my head just looking at those top 5 lines these days, I just want to rip it out completely. So I need a second opinion here. |
|
As I see modules by @ded (bonzo, valentine, domready, klass, reqwest):
So my thinking is that to have |
|
Well, don't rip it yet. Let me have a look with fresh eyes in the morning |
|
@jakutis |
|
I suspect var name = 'bean'
, context = this |
|
@ryanve, the problem with current /src/bean.js is that when it is evaluated in strict mode (with To sum up, in strict mode By the way, I will still do Here |
Fixes use case:
This use case is a minimal working example extracted from my custom module loader for the browser (think of yet another browserify).