mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-22 12:42:14 +00:00
Use self
instead of window
That should hopefully get us more compatible with web workers! Closes #144
This commit is contained in:
parent
055a8fb803
commit
45e4983e8c
@ -279,7 +279,7 @@ impl<'a> Context<'a> {
|
|||||||
return;
|
return;
|
||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
window.wasm_bindgen = Object.assign(init, __exports);
|
self.wasm_bindgen = Object.assign(init, __exports);
|
||||||
}})();
|
}})();
|
||||||
",
|
",
|
||||||
globals = self.globals,
|
globals = self.globals,
|
||||||
@ -747,8 +747,8 @@ impl<'a> Context<'a> {
|
|||||||
"));
|
"));
|
||||||
} else if !(self.config.browser || self.config.no_modules) {
|
} else if !(self.config.browser || self.config.no_modules) {
|
||||||
self.global(&format!("
|
self.global(&format!("
|
||||||
const TextEncoder = typeof window === 'object' && window.TextEncoder
|
const TextEncoder = typeof self === 'object' && self.TextEncoder
|
||||||
? window.TextEncoder
|
? self.TextEncoder
|
||||||
: require('util').TextEncoder;
|
: require('util').TextEncoder;
|
||||||
"));
|
"));
|
||||||
}
|
}
|
||||||
@ -767,8 +767,8 @@ impl<'a> Context<'a> {
|
|||||||
"));
|
"));
|
||||||
} else if !(self.config.browser || self.config.no_modules) {
|
} else if !(self.config.browser || self.config.no_modules) {
|
||||||
self.global(&format!("
|
self.global(&format!("
|
||||||
const TextDecoder = typeof window === 'object' && window.TextDecoder
|
const TextDecoder = typeof self === 'object' && self.TextDecoder
|
||||||
? window.TextDecoder
|
? self.TextDecoder
|
||||||
: require('util').TextDecoder;
|
: require('util').TextDecoder;
|
||||||
"));
|
"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user