-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Symbol member expression in class method definition (#…
…1602) Summary: ## Summary: This diff introduces support for [Symbol.iterator] and [Symbol.asyncIterator] as a method definition in flow defs generation. It can be confirmed in the flow lexer that these are the only two tokens prefixed with `@@`. Previously, that type of code wasn't supported and caused an exception: ```js export default { [Symbol.iterator]() {}; [Symbol.asyncIterator]() {}; } ``` The generated output if the type is not specified should be: ```js declare export default { @iterator(): void; @asyncIterator(): void; } ``` There are a few places in react-native source that will benefit from this, like: DOMRectList, URLSeachParams, NodeList and HTMLCollection. Changelog: [flow-api-translator] - Added support for Symbol member expression in class method definition Reviewed By: pieterv Differential Revision: D68766740
- Loading branch information
1 parent
bfb595f
commit 1917c0f
Showing
2 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters