diff options
author | kpdecker <kpdecker@gmail.com> | 2014-11-26 09:01:03 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-11-26 09:01:03 -0600 |
commit | 61dd721ca2a9055036d0f350970d033ca5227411 (patch) | |
tree | 398a184db4673792629973a3b11d9a46aa108bb0 /lib/handlebars/compiler/compiler.js | |
parent | 3a9440f954092558275cd4c05a35ba34bcbfa210 (diff) | |
download | handlebars.js-61dd721ca2a9055036d0f350970d033ca5227411.zip handlebars.js-61dd721ca2a9055036d0f350970d033ca5227411.tar.gz handlebars.js-61dd721ca2a9055036d0f350970d033ca5227411.tar.bz2 |
Update AST location info to match SpiderMonkey
Part of #889
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 1e5d07a..d80bfac 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -298,11 +298,7 @@ Compiler.prototype = { // HELPERS opcode: function(name, node) { - var loc = { - firstLine: node.firstLine, firstColumn: node.firstColumn, - lastLine: node.lastLine, lastColumn: node.lastColumn - }; - this.opcodes.push({ opcode: name, args: slice.call(arguments, 2), loc: loc }); + this.opcodes.push({ opcode: name, args: slice.call(arguments, 2), loc: node.loc }); }, addDepth: function(depth) { @@ -393,7 +389,7 @@ export function precompile(input, options, env) { options.useDepths = true; } - var ast = env.parse(input); + var ast = env.parse(input, options); var environment = new env.Compiler().compile(ast, options); return new env.JavaScriptCompiler().compile(environment, options); } @@ -415,7 +411,7 @@ export function compile(input, options, env) { var compiled; function compileInput() { - var ast = env.parse(input); + var ast = env.parse(input, options); var environment = new env.Compiler().compile(ast, options); var templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); return env.template(templateSpec); |