* [legacy decorators] Allow decorating generator methods
The old proposal used LeftHandSideExpression (instead of
AssignmentExpression) to satisfy this usecase:
e240cbc91a
* Update flow whitelist
* 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
* Disallow escape sequences in async
* Disallow escape sequences in get, set and async in class
* invalid escape tests
* Update whitelist
* tests for async in parens
* Add test for invalid newline between params and arrow
* Move canInsertSemilcolon() into shouldPArseAsyncArrow
* Refactor parsing object members
* Ensure decorators on rest don’t swallow decorators silently
* Use hasPrecedingLineBreak
* Add test for async with linebreak
* Update flow whitelist
* Introduce scope tracking
* Fix tests
* Add new tests
* Remove constructor-super check from transform as it is now in parser
* Correctly handle class properties and class scope
* Fix duplicate name check
* Convert scope identifier storage to array
* Enter a new scope in typescript module blocks
* Add test for duplicate declaration
* Rename error for duplicate exports
* Treat class declarations as lexical declaration
* Update whitelist
* Add tests
* Fix scope tracking for function declarations
* Migrate try-catch duplicate error
* Fix test
* More tests
* One more test
* Make scope a separate class and fix review comments
* Do not allow new.target in top scope arrow function
* Correctly enter new scope for declare module and treat type aliases as lexical declarations
* Tests for typescript scope tracking to not mark type aliases as duplicate
* Fix flow scope tracking
* Remove ident from test names as redundant
* Add test case for var and function
* Improve error messages
* Improve literal regex
* 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.
* Update parser whitespace for clarity
Has the nice benefit of not requiring a charCode to String conversion.
* Remove test262 exceptions
Per https://github.com/tc39/ecma262/pull/1218#issuecomment-395340891,
ECMA262 follows whatever the latest Unicode version specifies for Zs
Space_Separator category. MONGOLIAN VOWEL SEPARATOR was moved to the Cf
Other_Format category in Unicode 8.
* 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