Bug 1129770 - Deprecated.jsm can log 'null 0 null' as part of it's stack trace. r=mak
authorsirri <sirrichi98@gmail.com>
Mon, 08 Nov 2021 16:06:01 +0000
changeset 598563 52ec76164dcf353beaca1f178028f623b934c50d
parent 598562 83b804a449c2e52b98d7feb36c4dbbdd1065767f
child 598564 21d521ad0d72b781427a1da525ee7e26efb7b31d
push id152755
push usermak77@bonardo.net
push dateMon, 08 Nov 2021 16:20:25 +0000
treeherderautoland@52ec76164dcf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1129770
milestone96.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1129770 - Deprecated.jsm can log 'null 0 null' as part of it's stack trace. r=mak Differential Revision: https://phabricator.services.mozilla.com/D130558
toolkit/modules/Deprecated.jsm
--- a/toolkit/modules/Deprecated.jsm
+++ b/toolkit/modules/Deprecated.jsm
@@ -32,17 +32,19 @@ function stringifyCallstack(aStack) {
   if (!aStack || !(aStack instanceof Ci.nsIStackFrame)) {
     aStack = Components.stack.caller;
   }
 
   let frame = aStack.caller;
   let msg = "";
   // Get every frame in the callstack.
   while (frame) {
-    msg += frame.filename + " " + frame.lineNumber + " " + frame.name + "\n";
+    if (frame.filename || frame.lineNumber || frame.name) {
+      msg += frame.filename + " " + frame.lineNumber + " " + frame.name + "\n";
+    }
     frame = frame.caller;
   }
   return msg;
 }
 
 var Deprecated = {
   /**
    * Log a deprecation warning.