Skip to content

Commit

Permalink
Make library compatible with workers
Browse files Browse the repository at this point in the history
Pulled from 4.x branch, see #1894.
  • Loading branch information
jaylinski committed Oct 19, 2022
1 parent cafba53 commit ff774a5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/handlebars/no-conflict.js
Original file line number Diff line number Diff line change
@@ -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;
};
Expand Down

0 comments on commit ff774a5

Please sign in to comment.