DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Header

Mercurial (c68fe15a81fc)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/*
 * nsIScriptError implementation.
 */

#include "nsScriptError.h"
#include "nsScriptError.h"
#include "js/Printf.h"
#include "MainThreadUtils.h"
#include "mozilla/Assertions.h"
#include "nsContentUtils.h"
#include "nsGlobalWindow.h"
#include "nsGlobalWindow.h"
#include "nsNetUtil.h"
#include "nsPIDOMWindow.h"
#include "nsIMutableArray.h"
#include "nsIScriptError.h"
#include "mozilla/BasePrincipal.h"

nsScriptErrorBase::nsScriptErrorBase()
    : mMessage(),
      mMessageName(),
      mMessageName(),
      mSourceName(),
      mCssSelectors(),
      mSourceId(0),
      mSourceId(0),
      mLineNumber(0),
      mSourceLine(),
      mColumnNumber(0),
      mFlags(0),
      mCategory(),
      mCategory(),
      mOuterWindowID(0),
      mInnerWindowID(0),
      mTimeStamp(0),
      mInitializedOnMainThread(false),
      mIsFromPrivateWindow(false),
      mIsFromPrivateWindow(false),
      mIsFromChromeContext(false),
      mIsPromiseRejection(false),
      mIsForwardedFromContentProcess(false) {}


nsScriptErrorBase::~nsScriptErrorBase() = default;

void nsScriptErrorBase::AddNote(nsIScriptErrorNote* note) {
  mNotes.AppendObject(note);
}
void nsScriptErrorBase::InitializeOnMainThread() {

void nsScriptErrorBase::InitializeOnMainThread() {
  MOZ_ASSERT(NS_IsMainThread());
  MOZ_ASSERT(!mInitializedOnMainThread);

    nsGlobalWindowInner* window =
  if (mInnerWindowID) {
    nsGlobalWindowInner* window =
        nsGlobalWindowInner::GetInnerWindowWithId(mInnerWindowID);
    if (window) {
      nsPIDOMWindowOuter* outer = window->GetOuterWindow();
      if (outer) mOuterWindowID = outer->WindowID();
      mIsFromChromeContext = ComputeIsFromChromeContext(window);
      mIsFromPrivateWindow = ComputeIsFromPrivateWindow(window);
    }
    }
  }
  mInitializedOnMainThread = true;

  mInitializedOnMainThread = true;
}

NS_IMETHODIMP
  mSourceId = value;
nsScriptErrorBase::InitSourceId(uint32_t value) {
  mSourceId = value;
  return NS_OK;
}

NS_IMETHODIMP
// nsIConsoleMessage methods
NS_IMETHODIMP
nsScriptErrorBase::GetMessageMoz(nsAString& aMessage) {
  nsAutoCString message;
  nsresult rv = ToString(message);
    return rv;
  if (NS_FAILED(rv)) {
    return rv;
  }

  CopyUTF8toUTF16(message, aMessage);
}
  return NS_OK;
}

NS_IMETHODIMP
  if (mFlags & (uint32_t)nsIScriptError::infoFlag) {
nsScriptErrorBase::GetLogLevel(uint32_t* aLogLevel) {
  if (mFlags & (uint32_t)nsIScriptError::infoFlag) {
    *aLogLevel = nsIConsoleMessage::info;
  } else if (mFlags & (uint32_t)nsIScriptError::warningFlag) {
    *aLogLevel = nsIConsoleMessage::warn;
    *aLogLevel = nsIConsoleMessage::error;
  } else {
    *aLogLevel = nsIConsoleMessage::error;
  }
  return NS_OK;
}
// nsIScriptError methods

// nsIScriptError methods
NS_IMETHODIMP
NS_IMETHODIMP
nsScriptErrorBase::GetErrorMessage(nsAString& aResult) {
  aResult.Assign(mMessage);
  return NS_OK;
}


NS_IMETHODIMP
nsScriptErrorBase::GetSourceName(nsAString& aResult) {
  aResult.Assign(mSourceName);
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorBase::GetCssSelectors(nsAString& aResult) {
  aResult.Assign(mCssSelectors);
  aResult.Assign(mCssSelectors);
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorBase::SetCssSelectors(const nsAString& aCssSelectors) {
nsScriptErrorBase::SetCssSelectors(const nsAString& aCssSelectors) {
  mCssSelectors = aCssSelectors;
  return NS_OK;
}

NS_IMETHODIMP
NS_IMETHODIMP
nsScriptErrorBase::GetSourceId(uint32_t* result) {
  *result = mSourceId;
  return NS_OK;
}


NS_IMETHODIMP
nsScriptErrorBase::GetSourceLine(nsAString& aResult) {
  aResult.Assign(mSourceLine);
  return NS_OK;
}
}

NS_IMETHODIMP
  *result = mLineNumber;
nsScriptErrorBase::GetLineNumber(uint32_t* result) {
  *result = mLineNumber;
  return NS_OK;
}

nsScriptErrorBase::GetColumnNumber(uint32_t* result) {
NS_IMETHODIMP
nsScriptErrorBase::GetColumnNumber(uint32_t* result) {
  *result = mColumnNumber;
  return NS_OK;
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::GetFlags(uint32_t* result) {
  *result = mFlags;
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorBase::GetCategory(char** result) {
nsScriptErrorBase::GetCategory(char** result) {
  *result = ToNewCString(mCategory);
  return NS_OK;
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::GetHasException(bool* aHasException) {
  *aHasException = false;
  return NS_OK;

}

NS_IMETHODIMP
nsScriptErrorBase::GetException(JS::MutableHandleValue aException) {
  aException.setUndefined();
}
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorBase::SetException(JS::HandleValue aStack) {
nsScriptErrorBase::SetException(JS::HandleValue aStack) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

nsScriptErrorBase::GetStack(JS::MutableHandleValue aStack) {
NS_IMETHODIMP
nsScriptErrorBase::GetStack(JS::MutableHandleValue aStack) {
  aStack.setUndefined();
  return NS_OK;
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::SetStack(JS::HandleValue aStack) { return NS_OK; }

NS_IMETHODIMP
  aStackGlobal.setUndefined();
nsScriptErrorBase::GetStackGlobal(JS::MutableHandleValue aStackGlobal) {
  aStackGlobal.setUndefined();
  return NS_OK;
}

nsScriptErrorBase::GetErrorMessageName(nsAString& aErrorMessageName) {
NS_IMETHODIMP
nsScriptErrorBase::GetErrorMessageName(nsAString& aErrorMessageName) {
  aErrorMessageName = mMessageName;
  return NS_OK;
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::SetErrorMessageName(const nsAString& aErrorMessageName) {
  mMessageName = aErrorMessageName;
  return NS_OK;
}

static void AssignSourceNameHelper(nsString& aSourceNameDest,
                                   const nsAString& aSourceNameSrc) {
                                   const nsAString& aSourceNameSrc) {
  if (aSourceNameSrc.IsEmpty()) return;

  aSourceNameDest.Assign(aSourceNameSrc);
  aSourceNameDest.Assign(aSourceNameSrc);

  nsCOMPtr<nsIURI> uri;
  nsAutoCString pass;
  if (NS_SUCCEEDED(NS_NewURI(getter_AddRefs(uri), aSourceNameSrc)) &&
      NS_SUCCEEDED(uri->GetPassword(pass)) && !pass.IsEmpty()) {
    NS_GetSanitizedURIStringFromURI(uri, aSourceNameDest);
  }
}


static void AssignSourceNameHelper(nsIURI* aSourceURI,
                                   nsString& aSourceNameDest) {
  if (!aSourceURI) return;

  if (NS_FAILED(NS_GetSanitizedURIStringFromURI(aSourceURI, aSourceNameDest))) {
  if (NS_FAILED(NS_GetSanitizedURIStringFromURI(aSourceURI, aSourceNameDest))) {
    aSourceNameDest.AssignLiteral("[nsIURI::GetSpec failed]");
  }
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::Init(const nsAString& message, const nsAString& sourceName,
                        const nsAString& sourceLine, uint32_t lineNumber,
                        uint32_t columnNumber, uint32_t flags,
                        bool fromChromeContext) {
                        const char* category, bool fromPrivateWindow,
                        bool fromChromeContext) {
  InitializationHelper(message, sourceLine, lineNumber, columnNumber, flags,
                       category ? nsDependentCString(category) : EmptyCString(),
                       0 /* inner Window ID */, fromChromeContext);

  AssignSourceNameHelper(mSourceName, sourceName);

  mIsFromPrivateWindow = fromPrivateWindow;
  mIsFromChromeContext = fromChromeContext;
  return NS_OK;
}

void nsScriptErrorBase::InitializationHelper(
    uint32_t columnNumber, uint32_t flags, const nsACString& category,
    const nsAString& message, const nsAString& sourceLine, uint32_t lineNumber,
    uint32_t columnNumber, uint32_t flags, const nsACString& category,
    uint64_t aInnerWindowID, bool aFromChromeContext) {
  mMessage.Assign(message);
  mLineNumber = lineNumber;
  mColumnNumber = columnNumber;
  mSourceLine.Assign(sourceLine);
  mColumnNumber = columnNumber;
  mFlags = flags;
  mCategory = category;
  mTimeStamp = JS_Now() / 1000;
  mIsFromChromeContext = aFromChromeContext;
  mInnerWindowID = aInnerWindowID;
  mIsFromChromeContext = aFromChromeContext;
}

NS_IMETHODIMP
                                    const nsAString& sourceName,
nsScriptErrorBase::InitWithWindowID(const nsAString& message,
                                    const nsAString& sourceName,
                                    const nsAString& sourceLine,
                                    uint32_t lineNumber, uint32_t columnNumber,
                                    uint32_t flags, const nsACString& category,
                                    bool aFromChromeContext) {
                                    uint64_t aInnerWindowID,
                                    bool aFromChromeContext) {
  InitializationHelper(message, sourceLine, lineNumber, columnNumber, flags,
                       category, aInnerWindowID, aFromChromeContext);
  AssignSourceNameHelper(mSourceName, sourceName);

  if (aInnerWindowID && NS_IsMainThread()) InitializeOnMainThread();

  return NS_OK;
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::InitWithSanitizedSource(
    const nsAString& message, const nsAString& sourceName,
    const nsAString& sourceLine, uint32_t lineNumber, uint32_t columnNumber,
    bool aFromChromeContext) {
    uint32_t flags, const nsACString& category, uint64_t aInnerWindowID,
    bool aFromChromeContext) {
  InitializationHelper(message, sourceLine, lineNumber, columnNumber, flags,
                       category, aInnerWindowID, aFromChromeContext);
  mSourceName = sourceName;
  if (aInnerWindowID && NS_IsMainThread()) InitializeOnMainThread();

  if (aInnerWindowID && NS_IsMainThread()) InitializeOnMainThread();

  return NS_OK;
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::InitWithSourceURI(const nsAString& message,
                                     nsIURI* sourceURI,
                                     uint32_t lineNumber, uint32_t columnNumber,
                                     const nsAString& sourceLine,
                                     uint32_t lineNumber, uint32_t columnNumber,
                                     uint32_t flags, const nsACString& category,
                                     uint64_t aInnerWindowID,
                                     bool aFromChromeContext) {
                       category, aInnerWindowID, aFromChromeContext);
  InitializationHelper(message, sourceLine, lineNumber, columnNumber, flags,
                       category, aInnerWindowID, aFromChromeContext);
  AssignSourceNameHelper(sourceURI, mSourceName);

  if (aInnerWindowID && NS_IsMainThread()) InitializeOnMainThread();

  return NS_OK;
}

static nsresult ToStringHelper(const char* aSeverity, const nsString& aMessage,
static nsresult ToStringHelper(const char* aSeverity, const nsString& aMessage,
                               const nsString& aSourceName,
                               const nsString* aSourceLine,
                               uint32_t aLineNumber, uint32_t aColumnNumber,
  static const char format0[] =
                               nsACString& /*UTF8*/ aResult) {
  static const char format0[] =
      "[%s: \"%s\" {file: \"%s\" line: %d column: %d source: \"%s\"}]";
  static const char format1[] = "[%s: \"%s\" {file: \"%s\" line: %d}]";
  static const char format2[] = "[%s: \"%s\"]";
  JS::UniqueChars temp;

  JS::UniqueChars temp;
  char* tempMessage = nullptr;
  char* tempSourceName = nullptr;
  char* tempSourceLine = nullptr;
  if (!aMessage.IsEmpty()) tempMessage = ToNewUTF8String(aMessage);

  if (!aMessage.IsEmpty()) tempMessage = ToNewUTF8String(aMessage);
  if (!aSourceName.IsEmpty())
    // Use at most 512 characters from mSourceName.
  if (aSourceLine && !aSourceLine->IsEmpty())
    tempSourceName = ToNewUTF8String(StringHead(aSourceName, 512));
  if (aSourceLine && !aSourceLine->IsEmpty())
    // Use at most 512 characters from mSourceLine.
    tempSourceLine = ToNewUTF8String(StringHead(*aSourceLine, 512));

  if (nullptr != tempSourceName && nullptr != tempSourceLine) {
    temp = JS_smprintf(format0, aSeverity, tempMessage, tempSourceName,
    temp = JS_smprintf(format0, aSeverity, tempMessage, tempSourceName,
                       aLineNumber, aColumnNumber, tempSourceLine);
  } else if (!aSourceName.IsEmpty()) {
    temp = JS_smprintf(format1, aSeverity, tempMessage, tempSourceName,
                       aLineNumber);
  } else {
  } else {
    temp = JS_smprintf(format2, aSeverity, tempMessage);
  }

  if (nullptr != tempMessage) free(tempMessage);
  if (nullptr != tempSourceName) free(tempSourceName);
  if (nullptr != tempSourceName) free(tempSourceName);
  if (nullptr != tempSourceLine) free(tempSourceLine);

  if (!temp) return NS_ERROR_OUT_OF_MEMORY;

  aResult.Assign(temp.get());
  aResult.Assign(temp.get());
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorBase::ToString(nsACString& /*UTF8*/ aResult) {
nsScriptErrorBase::ToString(nsACString& /*UTF8*/ aResult) {
  static const char error[] = "JavaScript Error";
  static const char warning[] = "JavaScript Warning";

  const char* severity =
      !(mFlags & nsIScriptError::warningFlag) ? error : warning;
      !(mFlags & nsIScriptError::warningFlag) ? error : warning;

  return ToStringHelper(severity, mMessage, mSourceName, &mSourceLine,
                        mLineNumber, mColumnNumber, aResult);
                        mLineNumber, mColumnNumber, aResult);
}
}

nsScriptErrorBase::GetOuterWindowID(uint64_t* aOuterWindowID) {
NS_IMETHODIMP
nsScriptErrorBase::GetOuterWindowID(uint64_t* aOuterWindowID) {
  NS_WARNING_ASSERTION(NS_IsMainThread() || mInitializedOnMainThread,
                       "This can't be safely determined off the main thread, "
                       "returning an inaccurate value!");
  if (!mInitializedOnMainThread && NS_IsMainThread()) {

  if (!mInitializedOnMainThread && NS_IsMainThread()) {
    InitializeOnMainThread();
  }

  return NS_OK;
  *aOuterWindowID = mOuterWindowID;
  return NS_OK;
}

NS_IMETHODIMP
  *aInnerWindowID = mInnerWindowID;
nsScriptErrorBase::GetInnerWindowID(uint64_t* aInnerWindowID) {
  *aInnerWindowID = mInnerWindowID;
  return NS_OK;
}

nsScriptErrorBase::GetTimeStamp(int64_t* aTimeStamp) {
NS_IMETHODIMP
nsScriptErrorBase::GetTimeStamp(int64_t* aTimeStamp) {
  *aTimeStamp = mTimeStamp;
  return NS_OK;

}

NS_IMETHODIMP
nsScriptErrorBase::GetIsFromPrivateWindow(bool* aIsFromPrivateWindow) {
  NS_WARNING_ASSERTION(NS_IsMainThread() || mInitializedOnMainThread,
                       "This can't be safely determined off the main thread, "
                       "returning an inaccurate value!");

    InitializeOnMainThread();
  if (!mInitializedOnMainThread && NS_IsMainThread()) {
    InitializeOnMainThread();
  }

  *aIsFromPrivateWindow = mIsFromPrivateWindow;
  return NS_OK;
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorBase::GetIsFromChromeContext(bool* aIsFromChromeContext) {
  NS_WARNING_ASSERTION(NS_IsMainThread() || mInitializedOnMainThread,
  NS_WARNING_ASSERTION(NS_IsMainThread() || mInitializedOnMainThread,
                       "This can't be safely determined off the main thread, "
                       "returning an inaccurate value!");
  if (!mInitializedOnMainThread && NS_IsMainThread()) {
    InitializeOnMainThread();
  }
  }
  *aIsFromChromeContext = mIsFromChromeContext;
  return NS_OK;
}

NS_IMETHODIMP
NS_IMETHODIMP
nsScriptErrorBase::GetIsPromiseRejection(bool* aIsPromiseRejection) {
  *aIsPromiseRejection = mIsPromiseRejection;
  return NS_OK;
}


NS_IMETHODIMP
nsScriptErrorBase::InitIsPromiseRejection(bool aIsPromiseRejection) {
  mIsPromiseRejection = aIsPromiseRejection;
  return NS_OK;
}
NS_IMETHODIMP

NS_IMETHODIMP
nsScriptErrorBase::GetIsForwardedFromContentProcess(
    bool* aIsForwardedFromContentProcess) {
  *aIsForwardedFromContentProcess = mIsForwardedFromContentProcess;

  return NS_OK;
}

NS_IMETHODIMP

nsScriptErrorBase::SetIsForwardedFromContentProcess(
    bool aIsForwardedFromContentProcess) {
  mIsForwardedFromContentProcess = aIsForwardedFromContentProcess;
  return NS_OK;
}

bool nsScriptErrorBase::ComputeIsFromPrivateWindow(
NS_IMETHODIMP
nsScriptErrorBase::GetNotes(nsIArray** aNotes) {
  nsresult rv = NS_OK;
  nsCOMPtr<nsIMutableArray> array = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
  NS_ENSURE_SUCCESS(rv, rv);
  return aWindow->IsPrivateBrowsing() && !winPrincipal->IsSystemPrincipal();

  uint32_t len = mNotes.Length();
  for (uint32_t i = 0; i < len; i++) array->AppendElement(mNotes[i]);
  array.forget(aNotes);

    nsGlobalWindowInner* aWindow) {
  return NS_OK;
}

/* static */
bool nsScriptErrorBase::ComputeIsFromPrivateWindow(
NS_IMPL_ISUPPORTS(nsScriptError, nsIConsoleMessage, nsIScriptError)
    nsGlobalWindowInner* aWindow) {
  // Never mark exceptions from chrome windows as having come from private
  // windows, since we always want them to be reported.
  nsIPrincipal* winPrincipal = aWindow->GetPrincipal();
  return aWindow->IsPrivateBrowsing() && !winPrincipal->IsSystemPrincipal();
}
      mLineNumber(0),

/* static */
bool nsScriptErrorBase::ComputeIsFromChromeContext(
    nsGlobalWindowInner* aWindow) {
  nsIPrincipal* winPrincipal = aWindow->GetPrincipal();
void nsScriptErrorNote::Init(const nsAString& message,
  return winPrincipal->IsSystemPrincipal();
}

NS_IMPL_ISUPPORTS(nsScriptError, nsIConsoleMessage, nsIScriptError)
  mSourceId = sourceId;

nsScriptErrorNote::nsScriptErrorNote()
    : mMessage(),
      mSourceName(),
      mSourceId(0),
// nsIScriptErrorNote methods
      mLineNumber(0),
      mColumnNumber(0) {}

nsScriptErrorNote::~nsScriptErrorNote() = default;

}
void nsScriptErrorNote::Init(const nsAString& message,
                             const nsAString& sourceName, uint32_t sourceId,
                             uint32_t lineNumber, uint32_t columnNumber) {
  mMessage.Assign(message);
  AssignSourceNameHelper(mSourceName, sourceName);
  return NS_OK;
  mSourceId = sourceId;
  mLineNumber = lineNumber;
  mColumnNumber = columnNumber;
}
nsScriptErrorNote::GetSourceId(uint32_t* result) {

// nsIScriptErrorNote methods
NS_IMETHODIMP
nsScriptErrorNote::GetErrorMessage(nsAString& aResult) {
  aResult.Assign(mMessage);
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorNote::GetSourceName(nsAString& aResult) {
  aResult.Assign(mSourceName);
  return NS_OK;
nsScriptErrorNote::GetColumnNumber(uint32_t* result) {
}

NS_IMETHODIMP
nsScriptErrorNote::GetSourceId(uint32_t* result) {
  *result = mSourceId;
NS_IMETHODIMP
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorNote::GetLineNumber(uint32_t* result) {
  *result = mLineNumber;

  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorNote::GetColumnNumber(uint32_t* result) {
  *result = mColumnNumber;
  return NS_OK;
}

NS_IMETHODIMP
nsScriptErrorNote::ToString(nsACString& /*UTF8*/ aResult) {
  return ToStringHelper("JavaScript Note", mMessage, mSourceName, nullptr,
                        mLineNumber, mColumnNumber, aResult);
}

NS_IMPL_ISUPPORTS(nsScriptErrorNote, nsIScriptErrorNote)