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:
@@ -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
|
// eslint-disable-next-line no-unused-vars,no-var
|
||||||
var getJasmineRequireObj = (function(jasmineGlobal) {
|
var getJasmineRequireObj = (function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
let jasmineRequire;
|
let jasmineRequire;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ var getJasmineRequireObj = (function(jasmineGlobal) {
|
|||||||
jasmineRequire = exports;
|
jasmineRequire = exports;
|
||||||
} else {
|
} else {
|
||||||
// Browser
|
// Browser
|
||||||
jasmineRequire = jasmineGlobal.jasmineRequire = {};
|
jasmineRequire = globalThis.jasmineRequire = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJasmineRequire() {
|
function getJasmineRequire() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line no-unused-vars,no-var
|
// eslint-disable-next-line no-unused-vars,no-var
|
||||||
var getJasmineRequireObj = (function(jasmineGlobal) {
|
var getJasmineRequireObj = (function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
let jasmineRequire;
|
let jasmineRequire;
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ var getJasmineRequireObj = (function(jasmineGlobal) {
|
|||||||
jasmineRequire = exports;
|
jasmineRequire = exports;
|
||||||
} else {
|
} else {
|
||||||
// Browser
|
// Browser
|
||||||
jasmineRequire = jasmineGlobal.jasmineRequire = {};
|
jasmineRequire = globalThis.jasmineRequire = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getJasmineRequire() {
|
function getJasmineRequire() {
|
||||||
|
|||||||
Reference in New Issue
Block a user