Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transform
await
in computed class keys (#14391)
* test added * import correct tests * config file simplified Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com> * environmentVisitor merged but issue still persists * <<yarn --immutable-cache && git add yarn.lock>> is run * Rename test file * peerDependencies added, path.skip() removed and ArrowFunctionExpression skip added * Update packages/babel-plugin-proposal-async-generator-functions/src/index.ts Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com> * modified yarn.lock Co-authored-by: Nicol貌 Ribaudo <nicolo.ribaudo@gmail.com>
- Loading branch information
1 parent
767c7b4
commit 6347eaf
Showing
8 changed files
with
107 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 48 additions & 42 deletions
90
packages/babel-plugin-proposal-async-generator-functions/src/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...al-async-generator-functions/test/fixtures/async-generators/transform-class-keys/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
async function* fn() { | ||
class A { | ||
[yield 1]() {} | ||
} | ||
|
||
class B extends A { | ||
[await 1]() {} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...sync-generator-functions/test/fixtures/async-generators/transform-class-keys/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["proposal-async-generator-functions"] | ||
} |
18 changes: 18 additions & 0 deletions
18
...l-async-generator-functions/test/fixtures/async-generators/transform-class-keys/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function fn() { | ||
return _fn.apply(this, arguments); | ||
} | ||
|
||
function _fn() { | ||
_fn = babelHelpers.wrapAsyncGenerator(function* () { | ||
class A { | ||
[yield 1]() {} | ||
|
||
} | ||
|
||
class B extends A { | ||
[yield babelHelpers.awaitAsyncGenerator(1)]() {} | ||
|
||
} | ||
}); | ||
return _fn.apply(this, arguments); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters