Created
August 29, 2013 09:50
-
-
Save Gozala/6376195 to your computer and use it in GitHub Desktop.
Reproducible scenario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x = { | |
a: 1, | |
b 2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sandbox = Cu.Sandbox("http://example.com") | |
let { loadSubScript } = Cc['@mozilla.org/moz/jssubscript-loader;1']. | |
getService(Ci.mozIJSSubScriptLoader); | |
function load(uri) { | |
try { | |
loadSubScript(uri, sandbox) | |
} catch (error) { | |
return error | |
} | |
} | |
let error = load("file:///path/to/buggy.js") | |
error.lineNumber // => 3 | |
error.fileName // => Scratchpad/2 -> file:///Users/gozala/buggy.js | |
error.stack // => "" | |
// Stack should contain path to error.fileName and error.lineNumber |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment