Skip to content

Commit 7dc6a09

Browse files
committed
Use document instead of window for browser detection
GJS defines `window` as an alias for `globalThis`, but it isn't a real browser.
1 parent fde6da7 commit 7dc6a09

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

spec/core/baseSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('base helpers', function() {
1111
});
1212

1313
it('returns true for an Error that originated from another frame', function() {
14-
if (typeof window === 'undefined') {
14+
if (typeof document === 'undefined') {
1515
pending('This test only runs in browsers.');
1616
}
1717

spec/core/integration/EnvSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
describe('Env integration', function() {
22
let env;
3-
const isBrowser = typeof window !== 'undefined';
3+
const isBrowser = typeof document !== 'undefined';
44
const queueMicrotask =
55
globalThis.queueMicrotask ??
66
function(fn) {

spec/core/integration/GlobalErrorHandlingSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe('Global error handling (integration)', function() {
2-
const isBrowser = typeof window !== 'undefined';
2+
const isBrowser = typeof document !== 'undefined';
33
const queueMicrotask =
44
globalThis.queueMicrotask ??
55
function(fn) {

spec/core/jasmineNamespaceSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe('The jasmine namespace', function() {
105105
'getGlobal'
106106
]);
107107

108-
if (typeof window !== 'undefined') {
108+
if (typeof document !== 'undefined') {
109109
// jasmine-html.js
110110
result.add('HtmlReporterV2');
111111
result.add('HtmlReporterV2Urls');

0 commit comments

Comments
 (0)