fix: properly wrap private class methods (#12192)

This commit is contained in:
Huáng Jùnliàng
2020-10-16 10:12:50 -04:00
committed by GitHub
parent 31396b286d
commit a9cd0945b7
4 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
class C {
async * #g() {
this;
await 1;
yield 2;
return 3;
}
}

View File

@@ -0,0 +1,3 @@
{
"plugins": ["external-helpers", "proposal-private-methods", "proposal-async-generator-functions"]
}

View File

@@ -0,0 +1,19 @@
var _g = new WeakSet();
class C {
constructor() {
_g.add(this);
}
}
var _g2 = function _g2() {
var _this = this;
return babelHelpers.wrapAsyncGenerator(function* () {
_this;
yield babelHelpers.awaitAsyncGenerator(1);
yield 2;
return 3;
})();
};