* Use parseFunctionParams to parse method parameters
* [funct] Set this.state.inGenerator before parsing the function name/params
This allows "yield" inside generator parameters to be actually
parsed as a yield expression
* [funct] Disallow yield in function parameters
* [arrow] "yield" can start an arrow function (e.g. "yield => {}")
* [arrow] Disallow YieldExpressions inside arrow parameters.
* [err msg] Disallow yield as fn name in strict mode using checkReservedWord.
So Babylon throws "yield is a reserved word" instead of
a custom "Binding yield in strict mode"
* [err msg] "X is reserved in strict mode" should have precedence over "X is reserved", since it is more specific.
This was observable if "checkKeywords" is true and the word is both a keyword and a reserved
word in strict mode
* Disallow "yield" as an identifier inside generators
* [tests] Add tests, update wrong esprima tests and enable disabled esprima tests
* [tests] Move uncategorized tests to es2015/yield
* [tests] Update test262 whitelist
* Fix regression introduced by 8c77073
* [tests] Update flow whitelist
* Fix flow errors
- adds `get` and `set` kind in addition to `method` to the list of allowed class members for having a decorator,
- adds tests for this two cases (decorator + set and decorator + get)
* Add support for class private methods
This commit adds parser support for the TC39 Stage 2 Private Methods
proposal.
This commit also changes "key" in ClassPrivateProperty from an
Identifier to a PrivateName, as well as disallowing #constructor as a
valid private field name.
* Add tests for string literal get/set/async
These should be treated as regular methods and not special get/set/async
behaviour.
* Add tests for class private methods
This also removes a test from the Test262 whitelist that failed before
the changes for private methods support and now passes.
* Modify class private prop tests for PrivateName
* Add class private prop tests for #constructor
* Fix existing ASI test case failure
* Add optionality to catch bindings (plus tests)
* Update ast/spec, README, set param to null if no param with plugin optionalCatchBinding
* Fix: wrap param = null in else case
* Fix tests for optional catch binding; add tests which include finally clause
The parsing of private fields checks whether or not it is within a
class to determine if it is valid or not. However, the state.inClass
property is incorrect as it marks it as outside a class when the inner
class is closed.
This commit fixes this problem by replacing the state.inClass property
with a class nesting counter.
* Add plugin for import.meta proposal
Fixes https://github.com/babel/babylon/issues/539
* Tests for assignment/mutation of import.meta
* Use correct identifier in failure message
* Simpler & more consistent script errors for import.meta
* Add support for declare export
* Do not allow declare module inside declare module
* Reallow module exports outside module
* Add handling of `declare export default`
Add check for multiple module.export declarations
* Disallow export let/const/type
Refactor parsing object properties to share more code and add support
for getters and setters
* Rename tests
* Update test fixtures
* Optimize for performance
* disallow declare export interface outside of module
* Refactor code to be more readable and less lookahead
* Add comments
* Add test for export star as
* Test for number literal getter/setter
* Add more tests
* Fix tests
* Allow union types and correctly eat semi after type
* Use non computed keys
* Fix tests