{"action":"opened","issue":{"url":"https://api.github.com/repos/wycats/handlebars.js/issues/975","labels_url":"https://api.github.com/repos/wycats/handlebars.js/issues/975/labels{/name}","comments_url":"https://api.github.com/repos/wycats/handlebars.js/issues/975/comments","events_url":"https://api.github.com/repos/wycats/handlebars.js/issues/975/events","html_url":"https://github.com/wycats/handlebars.js/issues/975","id":60290214,"number":975,"title":"Issue with parent context reference (../) in precompiled templates","user":{"login":"dummerbd","id":8851361,"avatar_url":"https://avatars.githubusercontent.com/u/8851361?v=3","gravatar_id":"","url":"https://api.github.com/users/dummerbd","html_url":"https://github.com/dummerbd","followers_url":"https://api.github.com/users/dummerbd/followers","following_url":"https://api.github.com/users/dummerbd/following{/other_user}","gists_url":"https://api.github.com/users/dummerbd/gists{/gist_id}","starred_url":"https://api.github.com/users/dummerbd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dummerbd/subscriptions","organizations_url":"https://api.github.com/users/dummerbd/orgs","repos_url":"https://api.github.com/users/dummerbd/repos","events_url":"https://api.github.com/users/dummerbd/events{/privacy}","received_events_url":"https://api.github.com/users/dummerbd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-09T02:16:35Z","updated_at":"2015-03-09T02:16:35Z","closed_at":null,"body":"First day using Handlebars so maybe I'm just doing something wrong...\r\n\r\nI'm using Handlebars ~3.0.0 via Bower and I'm using `grunt-contrib-handlebars` to precompile my templates. Everything is working great but there seems to be an issue with using the `../var` parent context reference in precompiled templates. The same template with the same context data works fine when compiled in-browser.\r\n\r\nFor example:\r\n```hbs\r\n{{#each things}}\r\n  {{this}}, {{../topthing}};\r\n{{/each}}\r\n```\r\n\r\nPrecompiles into:\r\n```js\r\nthis[\"Templates\"][\"parent_context_test\"] = Handlebars.template({\"1\":function(depth0,helpers,partials,data,depths) {\r\n  var lambda=this.lambda, escapeExpression=this.escapeExpression;\r\n  return \"  \"\r\n    + escapeExpression(lambda(depth0, depth0))\r\n    + \", \"\r\n    + escapeExpression(lambda((depths[1] != null ? depths[1].topthing : depths[1]), depth0))\r\n    + \";\\n\";\r\n},\"compiler\":[6,\">= 2.0.0-beta.1\"],\"main\":function(depth0,helpers,partials,data,depths) {\r\n  var stack1, buffer = \"\";\r\n  stack1 = helpers.each.call(depth0, (depth0 != null ? depth0.things : depth0), {\"name\":\"each\",\"hash\":{},\"fn\":this.program(1, data, depths),\"inverse\":this.noop});\r\n  if (stack1 != null) { buffer += stack1; }\r\n  return buffer;\r\n},\"useDepths\":true});\r\n```\r\n\r\nCalling this template using a context:\r\n```js\r\nTemplates.parent_context_test({things: ['a','b','c'], topthing: 'yo'});\r\n```\r\n\r\nThis gives me an exception saying `depths` is undefined. It seems the `Handlebars.template` function is to blame."}}