praekeltfoundation / jspot

Extracts gettext strings from Javascript files into pot files
BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

Prevent undefined member expression in arguments #32

Closed JSteunou closed 9 years ago

JSteunou commented 9 years ago

Should definitely close #14 :)

justinvdm commented 9 years ago

Looks good, but I'm wondering if we should look out for other things. Maybe call expressions? Can't think of other things off the type of my head, but maybe we should maintain an array of the possible AST node types to look out for here?

JSteunou commented 9 years ago

Could be. Do you think people can do things like

gettext.ngettext('foo', 'foos', this.getCount(something));
justinvdm commented 9 years ago

Yup, I think we should allow people to have those kinds of cases in their code.

JSteunou commented 9 years ago

So something like this?

Do you see other possible cases?

JSteunou commented 9 years ago

Ouch it failed... broken other tests :( I could need some extra help on this one.

justinvdm commented 9 years ago

Yup, I think that looks good. Could we maybe pull the array out and attach it so some top-level variable in the module to make it easier to maintain?

justinvdm commented 9 years ago

Hmm, cool, will take a look.

justinvdm commented 9 years ago

@JSteunou making progress on a different idea, will push a commit in a few minutes.