Skip to content

Commit

Permalink
fix: in miniapp, globalSelf is existing
Browse files Browse the repository at this point in the history
  • Loading branch information
jinc.cjc committed Dec 3, 2019
1 parent 745a0d9 commit 4b6a9c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/shared/src/global.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function globalThis() {
function globalSelf() {
try {
if (typeof self !== 'undefined') {
return self
Expand All @@ -14,6 +14,6 @@ function globalThis() {
return global
}
} catch (e) {}
return Function('return this')
return Function('return this')()
}
export const globalThisPolyfill = globalThis()
export const globalThisPolyfill = globalSelf()

0 comments on commit 4b6a9c0

Please sign in to comment.