currentExecutingScript
currentExecutingScript copied to clipboard
Attempt to improve locating of correct inline scripts via function source code
Critical Piece:
Being able to get the function reference to the calling function, e.g. via _nearestExecutingScript.caller/arguments.callee.caller/arguments.caller. Seems like "use strict" (JS strict mode) usage will make this next to impossible/useless. :disappointed:
Research:
- http://jsbin.com/zifadipivo/12/edit
- http://jsbin.com/zifadipivo/12/
- http://jsbin.com/zifadipivo/12/?v8Hack=true
Further reading: http://stackoverflow.com/questions/16871050/inconsistent-scope-of-use-strict-on-different-web-browsers-concerning-argumen
Easily detect if executing in a strict mode context:
var isStrictMode = (function() { return !this; })();