Fix startup crash in Karma

The previous commit left one code path un-converted to globalThis. That
exposed a bug in Karma: Karma loads jasmine-core via <script type="module">
even though it's not an ES module. In ES modules, the value of `this`
outside of a method is undefined rather than window. The Angular dev tools
try to work around that bug by monkey-patching window to look like GJS's
window object, which worked until the GJS hack was removed in the previous
commit.
This commit is contained in:
Steve Gravrock
2025-10-05 08:42:31 -07:00
parent c4abf3265d
commit 67ef721c85
2 changed files with 4 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// eslint-disable-next-line no-unused-vars,no-var
var getJasmineRequireObj = (function(jasmineGlobal) {
var getJasmineRequireObj = (function() {
'use strict';
let jasmineRequire;
@@ -36,7 +36,7 @@ var getJasmineRequireObj = (function(jasmineGlobal) {
jasmineRequire = exports;
} else {
// Browser
jasmineRequire = jasmineGlobal.jasmineRequire = {};
jasmineRequire = globalThis.jasmineRequire = {};
}
function getJasmineRequire() {

View File

@@ -1,5 +1,5 @@
// eslint-disable-next-line no-unused-vars,no-var
var getJasmineRequireObj = (function(jasmineGlobal) {
var getJasmineRequireObj = (function() {
'use strict';
let jasmineRequire;
@@ -12,7 +12,7 @@ var getJasmineRequireObj = (function(jasmineGlobal) {
jasmineRequire = exports;
} else {
// Browser
jasmineRequire = jasmineGlobal.jasmineRequire = {};
jasmineRequire = globalThis.jasmineRequire = {};
}
function getJasmineRequire() {