Bug 355430 - Add the column to the error event. r=bz

This commit is contained in:
Tom Schuster 2014-03-20 16:46:28 +01:00
parent 75ecb45f05
commit 9491458ea6
2 changed files with 5 additions and 1 deletions

View File

@ -355,7 +355,7 @@ AsyncErrorReporter::AsyncErrorReporter(JSRuntime* aRuntime,
nsPIDOMWindow* aWindow)
: mSourceLine(static_cast<const char16_t*>(aErrorReport->uclinebuf))
, mLineNumber(aErrorReport->lineno)
, mColumn(aErrorReport->uctokenptr - aErrorReport->uclinebuf)
, mColumn(aErrorReport->column)
, mFlags(aErrorReport->flags)
{
if (!aErrorReport->filename) {
@ -483,6 +483,7 @@ public:
if (sameOrigin) {
init.mMessage = mErrorMsg;
init.mLineno = mLineNumber;
init.mColumn = mColumn;
init.mError = mError;
} else {
NS_WARNING("Not same origin error!");

View File

@ -179,6 +179,9 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
lineNumber.Construct();
lineNumber.Value() = scriptEvent->Lineno();
columnNumber.Construct();
columnNumber.Value() = scriptEvent->Column();
ThreadsafeAutoJSContext cx;
error.Construct(cx);
error.Value() = scriptEvent->Error(cx);