machty / emblem.js

Emblem.js - Ember-friendly, indented syntax alternative for Handlebars.js
http://emblemjs.com
MIT License
1.04k stars 81 forks source link

Fix quoteless action param deprecation #137

Closed BenV closed 10 years ago

BenV commented 10 years ago

This attempts to resolve the following deprecation warning which you get when using the shorthand notation for actions, etc (http://jsbin.com/jevev/2/edit)

DEPRECATION: Using a quoteless parameter with {{action}} is deprecated. Please update to quoted usage '{{action "blah"}}.
        at Object.handleRegisteredAction [as handler] (http://builds.emberjs.com/tags/v1.4.0/ember.js:37742:17)
        at HTMLAnchorElement.handleActionEvent (http://builds.emberjs.com/tags/v1.4.0/ember.js:21916:25)
        at Object.Ember.handleErrors (http://builds.emberjs.com/tags/v1.4.0/ember.js:907:17)
        at HTMLAnchorElement.<anonymous> (http://builds.emberjs.com/tags/v1.4.0/ember.js:21908:20)
        at HTMLBodyElement.jQuery.event.dispatch (http://code.jquery.com/jquery-2.0.2.js:4692:9)
        at HTMLBodyElement.elemData.handle (http://code.jquery.com/jquery-2.0.2.js:4377:6) 

I couldn't come up with a good test case for this, but that is likely because I am very new to pegjs and emblem in general. Suggestions for a test are very welcome, but it seems like this change needed to be made at a pretty low level. Here's a JSBin using an emblem.js from my branch: http://jsbin.com/jevev/1/edit - notice you can click the link without getting a warning in the console.

Also, I had to base this branch off of my other pull request to ensure the tests were all passing: https://github.com/machty/emblem.js/pull/136

Please let me know if you have any suggestions for changes, or if there is anything else I can do to help :smile: