From 1054b0d9952eeaaab04e68ffa7460a4cb7bd8b55 Mon Sep 17 00:00:00 2001 From: aceman Date: Mon, 17 Apr 2017 18:03:01 +0200 Subject: [PATCH] Bug 1357109 - Allow both .filename and .fileName property when dumping an exception in asyncTestUtils.js. r=jorgk --- mailnews/test/resources/asyncTestUtils.js | 5 +++-- mailnews/test/resources/logHelper.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mailnews/test/resources/asyncTestUtils.js b/mailnews/test/resources/asyncTestUtils.js index fafed668be..6fd3734dde 100644 --- a/mailnews/test/resources/asyncTestUtils.js +++ b/mailnews/test/resources/asyncTestUtils.js @@ -173,9 +173,10 @@ function _async_driver() { let asyncStack = []; dump("*******************************************\n"); dump("Generator explosion!\n"); - dump("Unhappiness at: " + ex.filename + ":" + ex.lineNumber + "\n"); + dump("Unhappiness at: " + (ex.fileName || ex.filename) + ":" + ex.lineNumber + "\n"); dump("Because: " + ex + "\n"); - dump("Stack:\n " + ex.stack.replace(/\n/g, "\n ") + "\n"); + if (ex.stack) + dump("Stack:\n " + ex.stack.replace(/\n/g, "\n ") + "\n"); dump("**** Async Generator Stack source functions:\n"); for (let i = asyncGeneratorStack.length - 1; i >= 0; i--) { dump(" " + asyncGeneratorStack[i][1] + "\n"); diff --git a/mailnews/test/resources/logHelper.js b/mailnews/test/resources/logHelper.js index 633624d57d..c9d5a1e1f6 100644 --- a/mailnews/test/resources/logHelper.js +++ b/mailnews/test/resources/logHelper.js @@ -478,7 +478,7 @@ function _normalize_for_json(aObj, aDepthAllowed, aJsonMeNotNeeded) { return { type: "error", message: "nsIException: " + aObj.name, - fileName: aObj.filename, + fileName: aObj.filename, // intentionally lower-case lineNumber: aObj.lineNumber, name: aObj.name, result: aObj.result,