Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit df82180

Browse files
committed
Bug 1563997: Handle webcompat Components stub in MozillaFileLogger.js. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D37938 --HG-- extra : rebase_source : dc1827f5a28dce10881d01461e7ff2a9889d1b65
1 parent dc7ff54 commit df82180

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

testing/mochitest/tests/SimpleTest/MozillaLogger.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ function importJSM(jsm) {
1818
return SpecialPowers.wrap(obj);
1919
}
2020

21-
let CC = (typeof Components === "object"
21+
// When running in release builds, we get a fake Components object in
22+
// web contexts, so we need to check that the Components object is sane,
23+
// too, not just that it exists.
24+
let haveComponents =
25+
typeof Components === "object" &&
26+
typeof Components.Constructor === "function";
27+
28+
let CC = (haveComponents
2229
? Components
2330
: SpecialPowers.wrap(SpecialPowers.Components)).Constructor;
2431

0 commit comments

Comments
 (0)