summaryrefslogtreecommitdiffstats
path: root/lib/handlebars.runtime.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars.runtime.js')
-rw-r--r--lib/handlebars.runtime.js21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/handlebars.runtime.js b/lib/handlebars.runtime.js
index 75a6a7a..3d05b54 100644
--- a/lib/handlebars.runtime.js
+++ b/lib/handlebars.runtime.js
@@ -1,4 +1,3 @@
-/*global window */
import * as base from './handlebars/base';
// Each of these augment the Handlebars object. No need to setup here.
@@ -8,6 +7,8 @@ import Exception from './handlebars/exception';
import * as Utils from './handlebars/utils';
import * as runtime from './handlebars/runtime';
+import noConflict from './handlebars/no-conflict';
+
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
function create() {
let hb = new base.HandlebarsEnvironment();
@@ -26,19 +27,11 @@ function create() {
return hb;
}
-let Handlebars = create();
-Handlebars.create = create;
+let inst = create();
+inst.create = create;
-/* istanbul ignore next */
-let root = typeof global !== 'undefined' ? global : window,
- $Handlebars = root.Handlebars;
-/* istanbul ignore next */
-Handlebars.noConflict = function() {
- if (root.Handlebars === Handlebars) {
- root.Handlebars = $Handlebars;
- }
-};
+noConflict(inst);
-Handlebars['default'] = Handlebars;
+inst['default'] = inst;
-export default Handlebars;
+export default inst;