Skip to content

Commit 6186128

Browse files
committed
Make library compatible with workers
Pulled from 4.x branch, see #1894.
1 parent 03fe783 commit 6186128

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/handlebars/no-conflict.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
export default function (Handlebars) {
2-
/* istanbul ignore next */
3-
let root = typeof global !== 'undefined' ? global : window, // eslint-disable-line no-undef
4-
$Handlebars = root.Handlebars;
2+
let $Handlebars = globalThis.Handlebars;
3+
54
/* istanbul ignore next */
65
Handlebars.noConflict = function () {
7-
if (root.Handlebars === Handlebars) {
8-
root.Handlebars = $Handlebars;
6+
if (globalThis.Handlebars === Handlebars) {
7+
globalThis.Handlebars = $Handlebars;
98
}
109
return Handlebars;
1110
};

0 commit comments

Comments
 (0)