-
Fix
super
inside arrow function inside loweredasync
function (#1425)When an
async
function is transformed into a regular function for target environments that don't supportasync
such as--target=es6
, references tosuper
inside that function must be transformed too since theasync
-to-regular function transformation moves the function body into a nested function, so thesuper
references are no longer syntactically valid. However, this transform didn't handle an edge case andsuper
references inside of an arrow function were overlooked. This release fixes this bug:// Original code class Foo extends Bar { async foo() { return () => super.foo() } } // Old output (with --target=es6) class Foo extends Bar { foo() { return __async(this, null, function* () { return () => super.foo(); }); } } // New output (with --target=es6) class Foo extends Bar { foo() { var __super = (key) => super[key]; return __async(this, null, function* () { return () => __super("foo").call(this); }); } }
-
Remove the implicit
/
after[dir]
in entry names (#1661)The "entry names" feature lets you customize the way output file names are generated. The
[dir]
and[name]
placeholders are filled in with the directory name and file name of the corresponding entry point file, respectively.Previously
--entry-names=[dir]/[name]
and--entry-names=[dir][name]
behaved the same because the value used for[dir]
always had an implicit trailing slash, since it represents a directory. However, some people want to be able to remove the file name with--entry-names=[dir]
and the implicit trailing slash gets in the way.With this release, you can now use the
[dir]
placeholder without an implicit trailing slash getting in the way. For example, the commandesbuild foo/bar/index.js --outbase=. --outdir=out --entry-names=[dir]
previously generated the fileout/foo/bar/.js
but will now generate the fileout/foo/bar.js
.