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/code-gen.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/code-gen.js')
-rw-r--r-- | lib/handlebars/compiler/code-gen.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/handlebars/compiler/code-gen.js b/lib/handlebars/compiler/code-gen.js index 7d1b4ca..30f0735 100644 --- a/lib/handlebars/compiler/code-gen.js +++ b/lib/handlebars/compiler/code-gen.js @@ -79,18 +79,18 @@ CodeGen.prototype = { }, empty: function(loc) { - loc = loc || this.currentLocation || {}; - return new SourceNode(loc.firstLine, loc.firstColumn, this.srcFile); + loc = loc || this.currentLocation || {start:{}}; + return new SourceNode(loc.start.line, loc.start.column, this.srcFile); }, wrap: function(chunk, loc) { if (chunk instanceof SourceNode) { return chunk; } - loc = loc || this.currentLocation || {}; + loc = loc || this.currentLocation || {start:{}}; chunk = castChunk(chunk, this, loc); - return new SourceNode(loc.firstLine, loc.firstColumn, this.srcFile, chunk); + return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); }, functionCall: function(fn, type, params) { |