- 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
* master:
Upgrade flow to 0.41
Throw error if new.target is used outside of a function (#402)
Fix watch command (#403)
Update yarn lock
Fix parsing of class properties (#351)
# Conflicts:
# src/parser/statement.js
# test/fixtures/experimental/class-constructor-call/illegal-key/options.json