diff options
author | machty <machty@gmail.com> | 2015-12-10 12:25:20 -0500 |
---|---|---|
committer | machty <machty@gmail.com> | 2015-12-10 14:22:45 -0500 |
commit | 3f77b82ed00dc1d71976de76bd4f8dfb6e885f2a (patch) | |
tree | 5b8e28cafb942cd7ed448e07e5e6076d95e73968 /lib/handlebars/compiler/compiler.js | |
parent | 205c61cfb1acdb599bbdfcf2d356641254e09e5c (diff) | |
download | handlebars.js-3f77b82ed00dc1d71976de76bd4f8dfb6e885f2a.zip handlebars.js-3f77b82ed00dc1d71976de76bd4f8dfb6e885f2a.tar.gz handlebars.js-3f77b82ed00dc1d71976de76bd4f8dfb6e885f2a.tar.bz2 |
Remove stringParams and trackIds mode
Closes #1145
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 987d0d4..9fa9dd8 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -49,8 +49,6 @@ Compiler.prototype = { this.opcodes = []; this.children = []; this.options = options; - this.stringParams = options.stringParams; - this.trackIds = options.trackIds; options.blockParams = options.blockParams || []; @@ -393,49 +391,7 @@ Compiler.prototype = { }, pushParam: function(val) { - let value = val.value != null ? val.value : val.original || ''; - - if (this.stringParams) { - if (value.replace) { - value = value - .replace(/^(\.?\.\/)*/g, '') - .replace(/\//g, '.'); - } - - if (val.depth) { - this.addDepth(val.depth); - } - this.opcode('getContext', val.depth || 0); - this.opcode('pushStringParam', value, val.type); - - if (val.type === 'SubExpression') { - // SubExpressions get evaluated and passed in - // in string params mode. - this.accept(val); - } - } else { - if (this.trackIds) { - let blockParamIndex; - if (val.parts && !AST.helpers.scopedId(val) && !val.depth) { - blockParamIndex = this.blockParamIndex(val.parts[0]); - } - if (blockParamIndex) { - let blockParamChild = val.parts.slice(1).join('.'); - this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild); - } else { - value = val.original || value; - if (value.replace) { - value = value - .replace(/^this(?:\.|$)/, '') - .replace(/^\.\//, '') - .replace(/^\.$/, ''); - } - - this.opcode('pushId', val.type, value); - } - } - this.accept(val); - } + this.accept(val); }, setupFullMustacheParams: function(sexpr, program, inverse, omitEmpty) { |