diff options
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 98f5396..d40e5f8 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -301,7 +301,15 @@ Compiler.prototype = { DATA: function(data) { this.options.data = true; - this.opcode('lookupData', data.id); + if (data.id.isScoped || data.id.depth) { + throw new Handlebars.Exception('Scoped data references are not supported: ' + data.original); + } + + this.opcode('lookupData'); + var parts = data.id.parts; + for(var i=0, l=parts.length; i<l; i++) { + this.opcode('lookup', parts[i]); + } }, STRING: function(string) { @@ -749,7 +757,7 @@ JavaScriptCompiler.prototype = { // // Push the result of looking up `id` on the current data lookupData: function(id) { - this.push(this.nameLookup('data', id, 'data')); + this.push('data'); }, // [pushStringParam] |