8000 Use `globalThis` (#908) · lowgrind/pyscript@1017362 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1017362

Browse files
authored
Use globalThis (pyscript#908)
1 parent f67b8e0 commit 1017362

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pyscriptjs/src/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ export function globalExport(name: string, obj: object) {
9797
// attach the given object to the global object, so that it is globally
9898
// visible everywhere. Should be used very sparingly!
9999

100-
// `window` in the browser, `global` in node
101-
const _global = window || global;
102-
_global[name] = obj;
100+
globalThis[name] = obj;
103101
}
104102

105103
export function getAttribute(el: Element, attr: string): string | null {

0 commit comments

Comments
 (0)
0