Created
October 3, 2013 17:03
-
-
Save kpdecker/6813240 to your computer and use it in GitHub Desktop.
compiled es6 module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var base = require("./handlebars/base"); | |
// Each of these augment the Handlebars object. No need to setup here. | |
// (This is done to easily share code between commonjs and browse envs) | |
var SafeString = require("./handlebars/safe-string")['default']; | |
var Exception = require("./handlebars/exception")['default']; | |
var Utils = require("./handlebars/utils"); | |
var runtime = require("./handlebars/runtime"); | |
// Compiler imports | |
var AST = require("./handlebars/compiler/ast"); | |
var Parser = require("./handlebars/compiler/base").parser; | |
var parse = require("./handlebars/compiler/base").parse; | |
var Compiler = require("./handlebars/compiler/compiler").Compiler; | |
var compile = require("./handlebars/compiler/compiler").compile; | |
var precompile = require("./handlebars/compiler/compiler").precompile; | |
var JavaScriptCompiler = require("./handlebars/compiler/javascript-compiler")['default']; | |
// For compatibility and usage outside of module systems, make the Handlebars object a namespace | |
var create = function() { | |
var hb = {}, | |
env = new base.HandlebarsEnvironment(); | |
// support new environments in global namespace mode | |
hb.registerHelper = env.registerHelper.bind(env); | |
hb.registerPartial = env.registerPartial.bind(env); | |
Utils.extend(hb, base); | |
hb.SafeString = SafeString; | |
hb.Exception = Exception; | |
hb.Utils = Utils; | |
hb.VM = runtime; | |
hb.template = runtime.template; | |
hb.compile = function(input, options) { | |
options = options || {}; | |
options.env = options.env || env; | |
return compile(input, options); | |
}; | |
hb.precompile = precompile; | |
hb.AST = AST; | |
hb.Compiler = Compiler; | |
hb.JavaScriptCompiler = JavaScriptCompiler; | |
hb.Parser = Parser; | |
hb.parse = parse; | |
return hb; | |
}; | |
var Handlebars = create(); | |
Handlebars.create = create; | |
exports['default'] = Handlebars; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is this?