Don't rely on Node.js global object

If `global` is used and handlebars is compiled for browser
usage without a Node.js `global` polyfill, handlebars
fails with a `global is undefined` error.

Fixes #1593
This commit is contained in:
Jakob Linskeseder
2021-12-03 21:49:32 +01:00
committed by Jay Linski
parent 8eefee56ff
commit 2954e7ea66
8 changed files with 317 additions and 163 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
export default function(Handlebars) {
/* istanbul ignore next */
let root = typeof global !== 'undefined' ? global : window,
let root = typeof global !== 'undefined' ? global : window, // eslint-disable-line no-undef
$Handlebars = root.Handlebars;
/* istanbul ignore next */
Handlebars.noConflict = function() {