-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert-prototype-extensions doesn't work with spread operators #15
Comments
@kamal got some time to review? @stefanpenner maybe can you add a failing example here https://github.com/abuiles/ember-watson/blob/master/tests/fixtures/prototype-extension-files/old.js and then we'll fix it |
actually, i think this is just a bug in recast as babel handles this fine:http://babeljs.io/repl/#?experimental=true&playground=false&evaluate=true&loose=true&spec=true&code=var%20keys%20%3D%20%5B'a'%2C%20'b'%2C%20'c'%5D%3B%0A%0Avar%20a%20%3D%20%7B%0A%20%20b%3A%20Ember.computed(...Keys%2C%20function()%20%7B%0A%20%20%20%20%0A%20%20%7D)%0A%7D I wonder if ember-watson would be better served by using the proposed transform API that lands with babel 5x (cc @sebmck, maybe you can share resources on this) |
Sounds like a good excuse to use Babel's transform :P Adolfo Builes On Mon, Mar 30, 2015 at 12:13 PM, Stefan Penner notifications@github.com
|
@sebmck has informed me, that babel isn't as good as recast when it comes to preserving input style |
Maybe simplest thing we can do is to detect the spread operator and call Ember.computed.apply(Ember, KEYS.concat([function(){}]) |
the following breaks:
because it transpiles to:
and because spread must be the final element in a list, or method signature, bad things happen.
The text was updated successfully, but these errors were encountered: