diff options
author | kpdecker <kpdecker@gmail.com> | 2013-01-21 00:13:56 -0600 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2013-01-21 00:21:17 -0600 |
commit | 8e9688792b3d387635c3850827b4e3b50a1d8ba0 (patch) | |
tree | f786837f818bd2458e5855fe03d070d5989468ac /lib/handlebars/compiler/compiler.js | |
parent | 9ac47df7ddfd477962c6ef7d7ece4cbf7a852e75 (diff) | |
download | handlebars.js-8e9688792b3d387635c3850827b4e3b50a1d8ba0.zip handlebars.js-8e9688792b3d387635c3850827b4e3b50a1d8ba0.tar.gz handlebars.js-8e9688792b3d387635c3850827b4e3b50a1d8ba0.tar.bz2 |
Use push rather than pushStack for inline ops
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 8b4d55a..9752124 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -652,7 +652,7 @@ Handlebars.JavaScriptCompiler = function() {}; // Looks up the value of `name` on the current context and pushes // it onto the stack. lookupOnContext: function(name) { - this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'), true); + this.push(this.nameLookup('depth' + this.lastContext, name, 'context')); }, // [pushContext] @@ -700,7 +700,7 @@ Handlebars.JavaScriptCompiler = function() {}; // // Push the result of looking up `id` on the current data lookupData: function(id) { - this.pushStack(this.nameLookup('data', id, 'data'), true); + this.push(this.nameLookup('data', id, 'data')); }, // [pushStringParam] @@ -740,7 +740,7 @@ Handlebars.JavaScriptCompiler = function() {}; if (this.options.stringParams) { this.register('hashTypes', '{' + hash.types.join(',') + '}'); } - this.pushStack('{\n ' + hash.values.join(',\n ') + '\n }', true); + this.push('{\n ' + hash.values.join(',\n ') + '\n }'); }, // [pushString] @@ -760,7 +760,7 @@ Handlebars.JavaScriptCompiler = function() {}; // // Push an expression onto the stack push: function(expr) { - this.pushStack(expr, true); + return this.pushStack(expr, true); }, // [pushLiteral] @@ -805,7 +805,7 @@ Handlebars.JavaScriptCompiler = function() {}; var helper = this.lastHelper = this.setupHelper(paramSize, name, true); - this.pushStack(helper.name, true); + this.push(helper.name); this.replaceStack(function(name) { return name + ' ? ' + name + '.call(' + helper.callParams + ") " + ": helperMissing.call(" + @@ -822,7 +822,7 @@ Handlebars.JavaScriptCompiler = function() {}; // so a `helperMissing` fallback is not required. invokeKnownHelper: function(paramSize, name) { var helper = this.setupHelper(paramSize, name); - this.pushStack(helper.name + ".call(" + helper.callParams + ")", true); + this.push(helper.name + ".call(" + helper.callParams + ")"); }, // [invokeAmbiguous] @@ -840,7 +840,7 @@ Handlebars.JavaScriptCompiler = function() {}; invokeAmbiguous: function(name, helperCall) { this.context.aliases.functionType = '"function"'; - this.pushStackLiteral('{}'); + this.pushStackLiteral('{}'); // Hash value var helper = this.setupHelper(0, name, helperCall); var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); @@ -867,7 +867,7 @@ Handlebars.JavaScriptCompiler = function() {}; } this.context.aliases.self = "this"; - this.pushStack("self.invokePartial(" + params.join(", ") + ")"); + this.push("self.invokePartial(" + params.join(", ") + ")"); }, // [assignToHash] @@ -952,7 +952,7 @@ Handlebars.JavaScriptCompiler = function() {}; }, pushStackLiteral: function(item) { - return this.pushStack(new Literal(item), true); + return this.push(new Literal(item)); }, pushStack: function(item, inline) { @@ -988,7 +988,7 @@ Handlebars.JavaScriptCompiler = function() {}; // Get or create the current stack name for use by the inline var name = this.stackSlot ? this.topStackName() : this.incrStack(); - prefix = '(' + this.pushStack(name, true) + ' = ' + top + '),'; + prefix = '(' + this.push(name) + ' = ' + top + '),'; stack = this.topStack(); } } else { @@ -1001,7 +1001,7 @@ Handlebars.JavaScriptCompiler = function() {}; if (this.inlineStack.length || this.compileStack.length) { this.popStack(); } - this.pushStack('(' + prefix + item + ')', true); + this.push('(' + prefix + item + ')'); } else { // Prevent modification of the context depth variable. Through replaceStack if (!/^stack/.test(stack)) { |