Closed Bug 486229 Opened 16 years ago Closed 14 years ago

implement @mozilla.org/scripterrorWithGlobal;1

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: johnjbarton, Unassigned)

References

(Blocks 1 open bug)

Details

Here is an outline of how to add the global object to script errors. create @mozilla.org/scripterrorWithGlobal;1 extending @mozilla.org/scripterror;1, add new interface nsIInGlobal: setGlobalObject(nsIScriptObjectPrincipal); nsIScriptObjectPrincipal getGlobalObject nsjsenvironment.cpp line 547 do_CreateInstance call with "@mozilla.org/scriptErrorWithGlobal". After errorObject->Init add if (NS_SUCCEEDED(rv)) { rv = errorObject->setGlobalObject(scriptPrincipal); ... continue with console service } That's it. An alternative would be to have the DOM event "error" actually be useful.
From m.d.platform John J Barton wrote: > I guess that this is sending an event that should be picked up by code like: > window.addEventListener('error', function echoErrors(event) > { > console.log("error event seen by testErrors:", event); > }, true); Maybe. Window onerror is special and passes extra arguments. See http://www.w3schools.com/JS/js_onerror.asp for example. So it's not normal DOM event dispatch. -Boris
OS: Linux → All
Hardware: x86 → All
Version: unspecified → Trunk
Component: Error Console → XPCOM
Product: Toolkit → Core
QA Contact: error.console → xpcom
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.