summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-10-09 03:20:22 -0700
committerkpdecker <kpdecker@gmail.com>2013-10-09 03:20:22 -0700
commitb6c9f85d227aad8ed2db9c04f0eed5a7c7131879 (patch)
treefd4def9155be1c00af1e9433dfda22617d228ffa /lib/handlebars/compiler/compiler.js
parent0966f5172b39151e0fa2d4830709efec7e58e4ca (diff)
downloadhandlebars.js-b6c9f85d227aad8ed2db9c04f0eed5a7c7131879.zip
handlebars.js-b6c9f85d227aad8ed2db9c04f0eed5a7c7131879.tar.gz
handlebars.js-b6c9f85d227aad8ed2db9c04f0eed5a7c7131879.tar.bz2
Use template env and compile methods
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js5
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.