Add explicitPartialContext compiler flag

Fixes #1032
This commit is contained in:
kpdecker
2015-09-01 01:05:00 -05:00
parent e7a64f018c
commit b63d74a7b3
2 changed files with 20 additions and 1 deletions
+5 -1
View File
@@ -177,7 +177,11 @@ Compiler.prototype = {
if (params.length > 1) {
throw new Exception('Unsupported number of partial arguments: ' + params.length, partial);
} else if (!params.length) {
params.push({type: 'PathExpression', parts: [], depth: 0});
if (this.options.explicitPartialContext) {
this.opcode('pushLiteral', 'undefined');
} else {
params.push({type: 'PathExpression', parts: [], depth: 0});
}
}
let partialName = partial.name.original,