Closed
Description
Using a language out of ECMASCRIPT_2015
, the following code produces invalid output.
Original:
class Foo {
async bar() {
console.log('bar');
}
}
class Baz extends Foo {
async bar() {
await Promise.resolve();
super.bar();
}
}
Compiled with:
java -jar compiler.jar -O=SIMPLE --language_out=ECMASCRIPT_2015 \
--renaming=false --formatting=PRETTY_PRINT --js test.js
Produces:
// Generator polyfills ...
class Foo {
bar() {
return $jscomp.asyncExecutePromiseGeneratorFunction(function*() {
console.log("bar");
});
}
}
class Baz extends Foo {
bar() {
const $jscomp$async$this = this;
return $jscomp.asyncExecutePromiseGeneratorFunction(function*() {
yield Promise.resolve();
super.bar.call($jscomp$async$this); // super is not a valid keyword here
});
}
}
Metadata
Metadata
Assignees
Labels
No labels