SpiderMonkey has something that we call ExpressionDecompiler [1]. Basically it allows us to decompile some subset of the JS bytecode. Fun fact: At some point in time SpiderMonkey could actually decompile all bytecode and this is how we used to generate the result of Function#toString. [2]
[1] https://dxr.mozilla.org/mozilla-central/search?q=ExpressionD... [2] https://bugzilla.mozilla.org/show_bug.cgi?id=718969
Re:Goodbye “undefined is not a function”
by notatoad on Sunday February 22, 2015 @11:40PM
(#9092583)
It doesn't seem relevant to the bug you posted, but as long as you're here... I'm always annoyed by the vagueness of JSON.parse syntax errors. Instead of showing the source file and line number of the call to json.parse (or even better the location of the syntax error in the json string it failed to parse) I get "uncaught syntax error in index.html:1". I know now that that usually means i've forgotten to wrap a json.parse in a try..catch, but it's caught me out a few times.
Thank you. This will save so much development time globally.
Please also look into the "Script error" message. I know it is intentionally non-descript to prevent leaking information about cross domain requests but there has to be something that is safe to report that will help developers narrow down what is causing it.
Re:Goodbye “undefined is not a function”
by jon-wood on Monday February 23, 2015 @04:36AM
(#9093387)
Given developers can usually narrow it down after a bit of trial and error I see no reason to obfuscate this. By its nature all the source is available to anyone asking, so let's just stop making CORS debugging such a pain.
Hey Paul great work! Any idea on when the promises support in the dev tools is landing?
Can it throw an exception when we're using a js library that isn't cool anymore?
Still, there are decent improvements we could make. Star, or better yet, comment on https://code.google.com/p/chromium/issues/detail?id=259443 with how you get caught out by weak error messages. We want the debugging cycle to be a lot more direct from error to fix.