es6-shim: es6-shim breaks Chrome App CSP
Unless sandboxed, es6-shim cannot run inside of Chrome Apps right now due to this line, which triggers the CSP, and is functionally an eval() statement.
I’m unsure if the best fix is reverting https://github.com/paulmillr/es6-shim/commit/ceeb51cc99bbe3729e96eae8c7af966a2d67dfde, or if a better solution can be found.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 1
- Comments: 32 (9 by maintainers)
Skimming the previous issues, this is a summary of my understanding:
Unless I’m missing something on that table, it sounds like checking
self, thenwindow, thenglobaland using the first one found would cover all these environments and avoid eval.@ljharb Using
var global = this;before loading es6-shim works with Nashorn too. Thanks!Perfect, that’s exactly what it’s supposed to do 😃 It appears that in WSH, the only option is to get
thisin the global context. http://stackoverflow.com/questions/14450424/equivalent-to-window-in-jscript-runtimeI’d suggest then that in wsh, users need to do something like
var global = this;in the global context prior to including thees6-shim.