Closed cyco closed 8 years ago
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!
) and we'll verify. Thanks.
I signed it!
CLAs look good, thanks!
Thank you for the patch.
One issue with this approach is that it does not work when eval is disabled (which is the case of CSP). So it needs to be wrapped in a try/catch with a fallback to the current ugly behavior.
Thanks for your feedback. I'll add the change you suggested and update the PR.
I like it 👍
Can you also add an entry to AUTHORS?
Done :)
Can you fix the merge conflict? Thanks.
The conflict should be resolved now.
The module store, runtime and symbol polyfills need access to the global object. This was done by checking the existance of
window
,global
,self
and falling back tothis
if none were defined. This can fail for two reasons. First,this
should be expected to be set toundefined
during module definitions (as is the case for symbols.js), thus rendering the fallback useless. Secondly some JavaScript implementations (e.g. JavaScript-Core Framework) might not even define a name for the global object that could be accessed within modules. By using the Function-Constructor we create a new function in non-strict mode which has its thisArg set to the gobal object if no other thisArg is provided.