Refactor await/yield production parameter tracking (#10956)

* test: add test fixtures

* refactor: track AWAIT and YIELD in separate handler

* fix flow errors

* add flow type annotation to production-parameter

* address review comments

* refactor: track [Return] parameter
This commit is contained in:
Huáng Jùnliàng
2020-02-09 23:31:29 +09:00
committed by GitHub
parent 8ab27c8ffe
commit 38529699d6
16 changed files with 650 additions and 73 deletions

View File

@@ -60,7 +60,7 @@ tt.name.updateContext = function(prevType) {
if (prevType !== tt.dot) {
if (
(this.state.value === "of" && !this.state.exprAllowed) ||
(this.state.value === "yield" && this.scope.inGenerator)
(this.state.value === "yield" && this.prodParam.hasYield)
) {
allowed = true;
}