Add TS support to @babel/parser's Scope (#9766)
* [parser] Allow plugins to extend ScopeHandler
* Directly extend Scope
* Don't use new.target to get the ScopeHandler
* [parser] Add TS enum support to the Scope
* Remove duplicated options in tests
* Fix
* Fix flow
* Rename tests
* Add tests
* Full typescript support in scope
* Remove BIND_SIMPLE_CATCH
SCOPE_SIMPLE_CATCH was used instead
* Export TS types
* Register function declarations
* Fix body-less functions and namespaces
1) Move this.scope.exit() for functions from parseFunctionBody to the callers.
Otherwise the scope of body-less functions was never closed.
Also, it is easier to track scope.exit() if it is near to scope.enter()
2) Register namespace ids for export
* Disallow redeclaration of enum with const enum
This commit is contained in:
@@ -2016,7 +2016,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
|
||||
checkLVal(
|
||||
expr: N.Expression,
|
||||
bindingType: ?BindingTypes = BIND_NONE,
|
||||
bindingType: BindingTypes = BIND_NONE,
|
||||
checkClashes: ?{ [key: string]: boolean },
|
||||
contextDescription: string,
|
||||
): void {
|
||||
|
||||
Reference in New Issue
Block a user