Make library compatible with workers
Pulled from 4.x branch, see #1894.
This commit is contained in:
committed by
Jay Linski
parent
03fe783a69
commit
6186128ad0
@@ -1,11 +1,10 @@
|
||||
export default function (Handlebars) {
|
||||
/* istanbul ignore next */
|
||||
let root = typeof global !== 'undefined' ? global : window, // eslint-disable-line no-undef
|
||||
$Handlebars = root.Handlebars;
|
||||
let $Handlebars = globalThis.Handlebars;
|
||||
|
||||
/* istanbul ignore next */
|
||||
Handlebars.noConflict = function () {
|
||||
if (root.Handlebars === Handlebars) {
|
||||
root.Handlebars = $Handlebars;
|
||||
if (globalThis.Handlebars === Handlebars) {
|
||||
globalThis.Handlebars = $Handlebars;
|
||||
}
|
||||
return Handlebars;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user