Skip to content

Commit d4c87ef

Browse files
authored
Merge pull request #105 from ReactiveDB/fix/global-self
fix(global): 令 reactivedb 能在 webworker 环境下运行
2 parents cdbe5db + 4c5e116 commit d4c87ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/global.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// lovefield nodejs polyfill
22
if (typeof global !== 'undefined') {
3-
global['self'] = global
3+
if (!global['self']) {
4+
global['self'] = global
5+
}
46
// shim for SinonJS
57
if (!global['location']) {
68
global['location'] = Object.create(null)

0 commit comments

Comments
 (0)