Use ID lookup for ambiguous helper evaluation

Final change for #731
This commit is contained in:
kpdecker
2014-07-07 00:20:02 -05:00
parent 107aa4a66a
commit c90cfe247c
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -245,6 +245,8 @@ Compiler.prototype = {
this.opcode('pushProgram', program);
this.opcode('pushProgram', inverse);
this.ID(id);
this.opcode('invokeAmbiguous', name, isBlock);
},
@@ -577,11 +577,12 @@ JavaScriptCompiler.prototype = {
this.aliases.functionType = '"function"';
this.useRegister('helper');
var nonHelper = this.popStack();
this.emptyHash();
var helper = this.setupHelper(0, name, helperCall);
var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
var nonHelper = '(depth' + this.lastContext + ' && ' + this.nameLookup('depth' + this.lastContext, name, 'context') + ')';
this.push(
'((helper = ' + helperName + ' || ' + nonHelper