Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compiling async arrows in uncompiled class fields (#14752)
* Refactor helper-wrap-function for better type inference * Fix compiling async arrows in uncompiled class fields
- Loading branch information
1 parent
b2da6e0
commit 4f278dc
Showing
10 changed files
with
101 additions
and
38 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
...transform-async-to-generator/test/fixtures/regression/in-uncompiled-class-fields/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,8 @@ | ||
// Angular needs to alwys compile async functions, even if | ||
// the targets support class fields. | ||
// https://github.com/babel/babel/issues/14749 | ||
|
||
class A { | ||
a = async () => this; | ||
b = async (x, y, z) => this; | ||
} |
25 changes: 25 additions & 0 deletions
25
...ransform-async-to-generator/test/fixtures/regression/in-uncompiled-class-fields/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,25 @@ | ||
// Angular needs to alwys compile async functions, even if | ||
// the targets support class fields. | ||
// https://github.com/babel/babel/issues/14749 | ||
class A { | ||
a = (() => { | ||
var _this = this; | ||
|
||
return babelHelpers.asyncToGenerator(function* () { | ||
return _this; | ||
}); | ||
})(); | ||
b = (() => { | ||
var _this2 = this; | ||
|
||
return function () { | ||
var _ref2 = babelHelpers.asyncToGenerator(function* (x, y, z) { | ||
return _this2; | ||
}); | ||
|
||
return function (_x, _x2, _x3) { | ||
return _ref2.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