Skip to content

Commit 138af6a

Browse files
committed
Make library compatible with workers
Pulled from 4.x branch, see #1894.
1 parent 236f582 commit 138af6a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/handlebars/no-conflict.js

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

0 commit comments

Comments
 (0)