diff options
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 0691a23..50195e3 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -1,5 +1,4 @@ import Exception from "../exception"; -import { template } from "../runtime"; import { parse } from "./base"; import JavaScriptCompiler from "./javascript-compiler"; module AST from "./ast"; @@ -428,7 +427,7 @@ export function precompile(input, options) { return new JavaScriptCompiler().compile(environment, options); } -export function compile(input, options) { +export function compile(input, options, env) { if (input == null || (typeof input !== 'string' && input.constructor !== AST.ProgramNode)) { throw new Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input); } @@ -445,7 +444,7 @@ export function compile(input, options) { var ast = parse(input); var environment = new Compiler().compile(ast, options); var templateSpec = new JavaScriptCompiler().compile(environment, options, undefined, true); - return template(templateSpec, options.env || Handlebars, compile); + return env.template(templateSpec); } // Template is only compiled on first use and cached after that point. |