-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Hello,
It looks like the latest version breaks when used with RequireJS (specifically handlebars.amd.js and handlebars.amd.min.js)
The problem exists in the following piece of code (starting at line 3859 in handlebars.amd.js):
var $Handlebars = global.Handlebars;
/* istanbul ignore next */
inst.noConflict = function () {
if (global.Handlebars === inst) {
global.Handlebars = $Handlebars;
}
};
And it can be fixed by using the snippet starting at line 724 of the same file:
var root = typeof global !== 'undefined' ? global : window,
$Handlebars = root.Handlebars;
/* istanbul ignore next */
Handlebars.noConflict = function () {
if (root.Handlebars === Handlebars) {
root.Handlebars = $Handlebars;
}
};
So the code in question should become:
var root = typeof global !== 'undefined' ? global : window,
$Handlebars = root.Handlebars;
/* istanbul ignore next */
inst.noConflict = function () {
if (root.Handlebars === inst) {
root.Handlebars = $Handlebars;
}
};
Metadata
Metadata
Assignees
Labels
No labels