diff options
Diffstat (limited to 'lib/handlebars/compiler/helpers.js')
-rw-r--r-- | lib/handlebars/compiler/helpers.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/handlebars/compiler/helpers.js b/lib/handlebars/compiler/helpers.js index 6cfc0e0..beaf988 100644 --- a/lib/handlebars/compiler/helpers.js +++ b/lib/handlebars/compiler/helpers.js @@ -52,28 +52,29 @@ export function preparePath(data, parts, locInfo) { return new this.PathExpression(data, depth, dig, original, locInfo); } -export function prepareMustache(sexpr, open, strip, locInfo) { +export function prepareMustache(path, params, hash, open, strip, locInfo) { /*jshint -W040 */ // Must use charAt to support IE pre-10 var escapeFlag = open.charAt(3) || open.charAt(2), escaped = escapeFlag !== '{' && escapeFlag !== '&'; - return new this.MustacheStatement(sexpr, escaped, strip, this.locInfo(locInfo)); + return new this.MustacheStatement(path, params, hash, escaped, strip, this.locInfo(locInfo)); } export function prepareRawBlock(openRawBlock, content, close, locInfo) { /*jshint -W040 */ - if (openRawBlock.sexpr.path.original !== close) { - var errorNode = {loc: openRawBlock.sexpr.loc}; + if (openRawBlock.path.original !== close) { + var errorNode = {loc: openRawBlock.path.loc}; - throw new Exception(openRawBlock.sexpr.path.original + " doesn't match " + close, errorNode); + throw new Exception(openRawBlock.path.original + " doesn't match " + close, errorNode); } locInfo = this.locInfo(locInfo); var program = new this.Program([content], null, {}, locInfo); return new this.BlockStatement( - openRawBlock.sexpr, program, undefined, + openRawBlock.path, openRawBlock.params, openRawBlock.hash, + program, undefined, {}, {}, {}, locInfo); } @@ -81,10 +82,10 @@ export function prepareRawBlock(openRawBlock, content, close, locInfo) { export function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { /*jshint -W040 */ // When we are chaining inverse calls, we will not have a close path - if (close && close.path && openBlock.sexpr.path.original !== close.path.original) { - var errorNode = {loc: openBlock.sexpr.loc}; + if (close && close.path && openBlock.path.original !== close.path.original) { + var errorNode = {loc: openBlock.path.loc}; - throw new Exception(openBlock.sexpr.path.original + ' doesn\'t match ' + close.path.original, errorNode); + throw new Exception(openBlock.path.original + ' doesn\'t match ' + close.path.original, errorNode); } program.blockParams = openBlock.blockParams; @@ -108,7 +109,8 @@ export function prepareBlock(openBlock, program, inverseAndProgram, close, inver } return new this.BlockStatement( - openBlock.sexpr, program, inverse, + openBlock.path, openBlock.params, openBlock.hash, + program, inverse, openBlock.strip, inverseStrip, close && close.strip, this.locInfo(locInfo)); } |