Restore helperMissing for ambiguous statements

Fixes #318 (regression)
Partial fix for #783
This commit is contained in:
kpdecker
2014-08-23 18:26:35 -05:00
parent cde008b49f
commit 0c7c37df6a
2 changed files with 17 additions and 1 deletions
@@ -551,6 +551,7 @@ JavaScriptCompiler.prototype = {
// `knownHelpersOnly` flags at compile-time.
invokeAmbiguous: function(name, helperCall) {
this.aliases.functionType = '"function"';
this.aliases.helperMissing = 'helpers.helperMissing';
this.useRegister('helper');
var nonHelper = this.popStack();
@@ -561,7 +562,7 @@ JavaScriptCompiler.prototype = {
var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
this.push(
'((helper = ' + helperName + ' || ' + nonHelper
'((helper = (helper = ' + helperName + ' || ' + nonHelper + ') != null ? helper : helperMissing'
+ (helper.paramsInit ? '),(' + helper.paramsInit : '') + '),'
+ '(typeof helper === functionType ? helper.call(' + helper.callParams + ') : helper))');
},