At the moment, submovies are fetched end executed differently for every environment:
in workers, the script is fetched via XHR and executed as a Function()
in iframes, the script is run in a sub-iframe
in node, the script is read from the file system and executed as a Function()
This has consequences like different scoping depending on the environment, and nearly-identical-but-slightly-different code fragments in context specific code.
We’ve introduced this behavior to make debugging in iframes easier and get real filenames in logs and debugged source code.
This is also possible by simply appending a special comment to the generated function, at least for webkit: //@ sourceURL=script/url.js
Using comments would allow us to remove redundant code and logic
At the moment, submovies are fetched end executed differently for every environment:
Function()
Function()
This has consequences like different scoping depending on the environment, and nearly-identical-but-slightly-different code fragments in context specific code.
We’ve introduced this behavior to make debugging in iframes easier and get real filenames in logs and debugged source code.
This is also possible by simply appending a special comment to the generated function, at least for webkit:
//@ sourceURL=script/url.js
Using comments would allow us to remove redundant code and logic