Open yonran opened 3 years ago
Previously, async-await.js would convert a getter/setter into an invalid async getter/setter.
Input:
class A { method() {return a().then(b => 'convert')} get prop() {return a().then(b => 'getter')} set prop(val) {return a(val).then(b => 'setter')} }
Output before this PR: async get and async set methods are created, but this is invalid ECMAScript and invalid TypeScript:
async get
async set
class A { async method() { const b = await a(); return 'convert'; } async get prop() { const b = await a(); return 'getter'; } async set prop(val) { const b = await a(val); return 'setter'; } }
Output after this PR: get and set methods are not converted to async.
get
set
class A { async method() { const b = await a(); return 'convert'; } get prop() {return a().then(b => 'getter')} set prop(val) {return a(val).then(b => 'setter')} }
Previously, async-await.js would convert a getter/setter into an invalid async getter/setter.
Input:
Output before this PR:
async get
andasync set
methods are created, but this is invalid ECMAScript and invalid TypeScript:Output after this PR:
get
andset
methods are not converted to async.