You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments