зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1200484 (part 8) - Use JS column numbers in EventSource. r=khuey.
--HG-- extra : rebase_source : 47264041521ebb053bd6d56b42570c6aedeecf4c
This commit is contained in:
Родитель
aba9cf51d8
Коммит
ddab35a56a
|
@ -69,6 +69,7 @@ EventSource::EventSource(nsPIDOMWindow* aOwnerWindow) :
|
|||
mLastConvertionResult(NS_OK),
|
||||
mReadyState(CONNECTING),
|
||||
mScriptLine(0),
|
||||
mScriptColumn(0),
|
||||
mInnerWindowID(0)
|
||||
{
|
||||
}
|
||||
|
@ -205,7 +206,8 @@ EventSource::Init(nsISupports* aOwner,
|
|||
|
||||
// The conditional here is historical and not necessarily sane.
|
||||
if (JSContext *cx = nsContentUtils::GetCurrentJSContext()) {
|
||||
nsJSUtils::GetCallingLocation(cx, mScriptFile, &mScriptLine);
|
||||
nsJSUtils::GetCallingLocation(cx, mScriptFile, &mScriptLine,
|
||||
&mScriptColumn);
|
||||
mInnerWindowID = nsJSUtils::GetCurrentlyRunningCodeInnerWindowID(cx);
|
||||
}
|
||||
|
||||
|
@ -987,7 +989,7 @@ EventSource::PrintErrorOnConsole(const char *aBundleURI,
|
|||
rv = errObj->InitWithWindowID(message,
|
||||
mScriptFile,
|
||||
EmptyString(),
|
||||
mScriptLine, 0,
|
||||
mScriptLine, mScriptColumn,
|
||||
nsIScriptError::errorFlag,
|
||||
"Event Source", mInnerWindowID);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -255,12 +255,14 @@ protected:
|
|||
|
||||
// Event Source owner information:
|
||||
// - the script file name
|
||||
// - source code line number where the Event Source object was constructed.
|
||||
// - source code line number and column number where the Event Source object
|
||||
// was constructed.
|
||||
// - the ID of the inner window where the script lives. Note that this may not
|
||||
// be the same as the Event Source owner window.
|
||||
// These attributes are used for error reporting.
|
||||
nsString mScriptFile;
|
||||
uint32_t mScriptLine;
|
||||
uint32_t mScriptColumn;
|
||||
uint64_t mInnerWindowID;
|
||||
|
||||
private:
|
||||
|
|
Загрузка…
Ссылка в новой задаче