Skip to content

Commit 7ebe6d3

Browse files
authored
use globalThis instead of window (microsoft#218368)
fixes microsoft#214945
1 parent d193d82 commit 7ebe6d3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/vs/base/browser/trustedTypes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { mainWindow } from 'vs/base/browser/window';
76
import { onUnexpectedError } from 'vs/base/common/errors';
87

98
export function createTrustedTypesPolicy<Options extends TrustedTypePolicyOptions>(
@@ -28,7 +27,7 @@ export function createTrustedTypesPolicy<Options extends TrustedTypePolicyOption
2827
}
2928
}
3029
try {
31-
return mainWindow.trustedTypes?.createPolicy(policyName, policyOptions);
30+
return (globalThis as any).trustedTypes?.createPolicy(policyName, policyOptions);
3231
} catch (err) {
3332
onUnexpectedError(err);
3433
return undefined;

0 commit comments

Comments
 (0)