-
Notifications
You must be signed in to change notification settings - Fork 26
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
Do not require args when creating a CallExpression #42
Conversation
I'm not sure if this is related to this patch, but when running a dry-run on all locales, I see failures on some of them (old ones, like csb, ve, ss). The error happens on the PLATFORM() migration
|
csb doesn't have I propose that in this case, we shouldn't try to resurrect the message with partial platform support. Different bug, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Please land a corresponding change to fluent-syntax in JS to make sure args
is always an array.
fluent/syntax/ast.py
Outdated
super(CallExpression, self).__init__(**kwargs) | ||
self.callee = callee | ||
self.args = args | ||
self.args = args if args is not None else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be written more succinctly as args or []
. It is also the convention used by other classes in this file.
There's bug 1321271 about supporting partial migrations. I think it's a big feature which is out of the scope of the upcoming L20n milestone. I submitted #44 to prevent the error @flodolo ran into by explicitly never allowing partial migrations for now. |
776ff84
to
268b13a
Compare
While working on https://bugzilla.mozilla.org/show_bug.cgi?id=1424682 I noticed that it's not possible to create a
CallExpression
without passing args, even if empty.I think it'll be pretty common in migration code to want to call
FTL.CallExpression("PLATFORM")
etc.