User:GijsKruitbosch/JS Debugging/DocumentFromException: Difference between revisions

No edit summary
Line 15: Line 15:
== Discussion ==
== Discussion ==


Rob showed me an easier, all JS way:


Rob showed me an easier, all JS way:
The starting point is the jsdIStackFrame "frame" parameter in [http://lxr.mozilla.org/mozilla/source/extensions/venkman/resources/content/venkman-debugger.js#251 function jsdExecutionHook], from which we obtain the globalObject of its executionContext.
 
We then continue chasing references from globalObject and finally get to a window thanks to [http://lxr.mozilla.org/mozilla/source/extensions/venkman/resources/content/venkman-utils.js#602 getBaseWindowFromWindow].


http://lxr.mozilla.org/mozilla/source/extensions/venkman/resources/content/venkman-debugger.js#249
''This is a fine solution but I fail to see how this can be used to react only to '''uncaught''' exceptions. For this purpose Plan A seems the way to go since it becomes an "error" only once nobody caught it.''
note the following line in that function:
http://lxr.mozilla.org/mozilla/source/extensions/venkman/resources/content/venkman-debugger.js#308
2

edits