From 3d2f51eeb4e26f0c7b40716d611a6a781e5c2c68 Mon Sep 17 00:00:00 2001 From: aidenlx <31102694+aidenlx@users.noreply.github.com> Date: Mon, 18 May 2026 15:07:27 +0800 Subject: [PATCH] Fix Zotero.log() script error initialization --- chrome/content/zotero/xpcom/zotero.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index e6c17ba7b8..04b1bbdb28 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1311,8 +1311,16 @@ const { CommandLineOptions } = ChromeUtils.importESModule("chrome://zotero/conte /* * Log a message to the Mozilla JS error console * - * |type| is a string with one of the flag types in nsIScriptError: - * 'error', 'warning', 'exception', 'strict' + * |type| is a string matching one of the flag constants on nsIScriptError. + * As of Firefox 140 ESR only three are defined: + * 'error' -> errorFlag (0x0, default) + * 'warning' -> warningFlag (0x1) + * 'info' -> infoFlag (0x8) + * The legacy 'exception' and 'strict' values have been removed upstream; + * passing them yields an undefined flag and silently falls back to errorFlag. + * + * |sourceLine| is no longer accepted by nsIScriptError.init(), but is kept + * in the signature for compatibility with older Zotero.log() callers. */ this.log = function (message, type, sourceName, sourceLine, lineNumber, columnNumber) { var scriptError = Components.classes["@mozilla.org/scripterror;1"] @@ -1326,7 +1334,6 @@ const { CommandLineOptions } = ChromeUtils.importESModule("chrome://zotero/conte scriptError.init( message, sourceName ? sourceName : null, - sourceLine != undefined ? sourceLine : null, lineNumber != undefined ? lineNumber : null, columnNumber != undefined ? columnNumber : null, flags,