emberjs/ember.js — pull request #3030 by stephendeyoung (2013-07-21 12:10:51+00:00)
Title: The Ember Handlebars precompiler throws an error when using variables beginning with '@'

In Handlebars templates you should be able to use a variable beginning with `@`. Handlebars itself provides the `@index` variable inside an `#each` block. However, using any variable beginning with `@` such as `@index` or any other variable you might define using a Handlebars helper will throw an error:

SyntaxError: Unexpected token ,
at Object.Function ()
at Object.JavaScriptCompiler.createFunctionContext (http://localhost:9292/handlebars.js:1500:23)
at Object.JavaScriptCompiler.compile (http://localhost:9292/handlebars.js:1415:17)
at Object.Ember.Handlebars.precompile (ember-handlebars-compiler:247:52)
at Object.templateString (ember-handlebars/~tests/handlebars_test:1812:41)
at Object.Test.run (http://localhost:9292/qunit/qunit.js:190:18)
at http://localhost:9292/qunit/qunit.js:348:10
at process (http://localhost:9292/qunit/qunit.js:1420:24)
at http://localhost:9292/qunit/qunit.js:466:5

Using the ordinary Handlebars precompiler does not throw an error when you try to use an `@` variable.

You can see the [`@index` error here](http://jsbin.com/ucanam/398/edit) and the [custom variable error here](http://jsbin.com/ucanam/399/edit). This pull request includes two failing unit tests.