Skip to content

Conversation

stasm
Copy link
Contributor

@stasm stasm commented Feb 15, 2019

The fields of our AST nodes are usually spelled out as full words. The only exception being the id, which I think is common enough to almost function on its own as a word, and args. This PR renames args to arguments, to match other names such as attributes, annotations etc.

For implementations, this has both upsides and downsides. In Python, we've seen how args is a special attribute of Exception which cannot be anything else than a tuple. In JavaScript, arguments may not be used as a variable binding in the strict mode. This would make destructuring assignment, such as in let {id, arguments} = refNode; impossible. The workaround is to use refNode.arguments directly, or to reassign the property: let {id, arguments: args} = refNode.

@stasm stasm requested a review from Pike February 15, 2019 14:12
@stasm stasm merged commit 5e304d1 into projectfluent:master Feb 15, 2019
@stasm stasm deleted the args-arguments branch February 15, 2019 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants