* flow - allow type parameter defaults in function declarations
* fix flow test
* add intern_comments option
* fix flow parser test
* remove allowdefault from flowParseTypeParameterDeclaration
* rename test cases
* Refactor parsing object members
* Ensure decorators on rest don’t swallow decorators silently
* Use hasPrecedingLineBreak
* Add test for async with linebreak
* Update flow whitelist
* check for spaces and tabs before a flow comment
* fix issue with using string index and shift interchangably
* update tests
* Use update charcodes version
* Disallow flow-comments in flow-comments and check for unterminated comments
These are now enabled by default:
- objectRestSpread (2018)
- asyncGenerators (2018)
- optionalCatchBInding (2019)
- jsonStrings (2019)
TODO (after this commit):
- [ ] Deprecate the `@babel/plugin-syntax-*` packages.
- [ ] Deprecate the `@babel/plugin-proposal-*` packages.
- [ ] Create the `@babel/plugin-transform-*` packages.
* Fix private property parsing in Flow
* Flow tests updated
* Fix type error
* Appropriate name was given to test folder
* Fix
* Empty
* Correct type annotation
* Add required changes in generator package
* Add required changes in flow-strip-types
<!--
Before making a PR please make sure to read our contributing guidelines
https://github.com/babel/babel/blob/master/CONTRIBUTING.md
For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. It should be underlined in the preview if done correctly.
-->
| Q | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues? | <!-- remove the (`) quotes to link the issues -->
| Patch: Bug Fix? |
| Major: Breaking Change? | No
| Minor: New Feature? | Yes
| Tests Added + Pass? | Yes
| Documentation PR | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes? |
| License | MIT
See eb815be907 for more information about this feature.
The proto modifier indicates that a property declared using `x: T` syntax is actually present on the prototype object of the class, rather than an own property.
The proto and static modifiers are mutually exclusive, as class declarations don't simultaneously define the static prototype object, as they do the instance prototype.
This syntax is only supported on declared classes, not object types, interfaces, or runtime class declarations, and as such should only appear in library definitions.
* Add all option to babel-plugin-syntax-flow
The Flow parser has some conditional logic based on whether types should
be parsed or not, which is based on either (a) the @flow pragma in the
docblock of the file of (b) the `all` configuration, provided via
command line or .flowconfig.
This commit adds the ability to provide the `all` configuration to
Babel as well, via the syntax-flow plugin. This should be set to `true`
if the project uses all=true.
* Parse @flow pragma
The Flow parser has some conditional logic based on whether types should
be parsed or not, which is based on either (a) the @flow pragma in the
docblock of the file of (b) the `all` configuration, provided via
command line or .flowconfig.
This commit parses the @flow (or @noflow) pragma from the first comment
in the source file. Directives are allowed to appear before the comment.
* WIP: add tests for explicit type arguments
This commit includes tests which have unexpected output, but will change
to the expected output as later commits add parsing support for various
features.
* Parse type arguments in new expressions
* Parse type arguments in call expressions
* Parse optional call expressions with explicit type args
* Add explicit type arguments to babel-types
Flow calls these typeArguments instead of typeParameters, which clearly
separates formal/actual parameters, and mirrors the existing arguments
key.
The existing definitions to support TypeScript also included Flow's
TypeParameterInstantiation node type, which I've moved to the the new
field.
* Add support for explicit type arguments to babel-generator
* Add test for explicit type args to transform-flow-strip-types plugin
* Oops. Forgot to regenerate the babel-types README.
* Fix Flow parser shouldParseTypes() function
I was looking at `options.all`, but the correct property ws
`options.flowAll`. Oops!
* Remove typeapp_call from whitelist of expected failures
Now that Babylon parses this syntax extension, we can remove the
typeapp_call tests from the list of expected differences.
Note that I am using the `flowAll` option, mirroring the behavior of the
Flow tests, which assume types without requiring the `@flow` pragma.
* Use Babylon plugin options instead of parser options
* Parse optional call expressions type arguments unambiguously
* Support internalSlots to babel-types and babel-generator
* Parsing support for internal slot properties
* Print internal slots in babel-generator
* Add whitespace before first internal slot property