Skip to content

Commit

Permalink
use ASI for appended export syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferbaxter committed Dec 29, 2019
1 parent a61269e commit 2bd7ec7
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/transformers/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default class ExportTransform extends Transform implements TransformInter
const toAppend = collectedExportsToAppend.get(exportSource);
if (toAppend && toAppend.length > 0) {
if (exportSource === null) {
source.append(`export{${toAppend.join(',')}};`);
source.append(`export{${toAppend.join(',')}}`);
} else {
source.prepend(`export{${toAppend.join(',')}}from'${exportSource}';`);
}
Expand Down
2 changes: 1 addition & 1 deletion test/export-all/fixtures/all.esm.advanced.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var export1=1;function export2(){return 2};export{export1,export2};
var export1=1;function export2(){return 2};export{export1,export2}
2 changes: 1 addition & 1 deletion test/export-all/fixtures/all.esm.default.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var export1=1;function export2(){return 2};export{export1,export2};
var export1=1;function export2(){return 2};export{export1,export2}
2 changes: 1 addition & 1 deletion test/export-all/fixtures/all.esm.es5.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var export1=1;function export2(){return 2};export{export1,export2};
var export1=1;function export2(){return 2};export{export1,export2}
2 changes: 1 addition & 1 deletion test/export-named/fixtures/multiple.esm.advanced.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
class b{constructor(a){this.a=a}console(){console.log(this.a)}}function bar(){console.log(1)};function baz(a){console.log(a)};var foo=1;export{b as ExportedClass,bar,baz,foo};
class b{constructor(a){this.a=a}console(){console.log(this.a)}}function bar(){console.log(1)};function baz(a){console.log(a)};var foo=1;export{b as ExportedClass,bar,baz,foo}
2 changes: 1 addition & 1 deletion test/export-named/fixtures/multiple.esm.default.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
class b{constructor(a){this.name_=a}console(){console.log(this.name_)}}function bar(){console.log(1)};function baz(a){console.log(a)};var foo=1;export{b as ExportedClass,bar,baz,foo};
class b{constructor(a){this.name_=a}console(){console.log(this.name_)}}function bar(){console.log(1)};function baz(a){console.log(a)};var foo=1;export{b as ExportedClass,bar,baz,foo}
2 changes: 1 addition & 1 deletion test/export-named/fixtures/multiple.esm.es5.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
function b(a){this.name_=a}b.prototype.console=function(){console.log(this.name_)};function bar(){console.log(1)};function baz(a){console.log(a)};var foo=1;export{b as ExportedClass,bar,baz,foo};
function b(a){this.name_=a}b.prototype.console=function(){console.log(this.name_)};function bar(){console.log(1)};function baz(a){console.log(a)};var foo=1;export{b as ExportedClass,bar,baz,foo}
2 changes: 1 addition & 1 deletion test/export-variables/fixtures/class.esm.advanced.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
class a{constructor(b){this.a=b}console(){console.log(this.a)}}export{a as Exported};
class a{constructor(b){this.a=b}console(){console.log(this.a)}}export{a as Exported}
2 changes: 1 addition & 1 deletion test/export-variables/fixtures/class.esm.default.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
class a{constructor(b){this.name_=b}console(){console.log(this.name_)}}export{a as Exported};
class a{constructor(b){this.name_=b}console(){console.log(this.name_)}}export{a as Exported}
2 changes: 1 addition & 1 deletion test/export-variables/fixtures/class.esm.es5.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
function a(b){this.name_=b}a.prototype.console=function(){console.log(this.name_)};export{a as Exported};
function a(b){this.name_=b}a.prototype.console=function(){console.log(this.name_)};export{a as Exported}
2 changes: 1 addition & 1 deletion test/provided-externs/fixtures/class.esm.advanced.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
class a{constructor(b){this.a=b}console(){console.log(this.a)}}export{a as ExportThis};
class a{constructor(b){this.a=b}console(){console.log(this.a)}}export{a as ExportThis}
2 changes: 1 addition & 1 deletion test/provided-externs/fixtures/class.esm.default.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
class a{constructor(b){this.name_=b}console(){console.log(this.name_)}}export{a as ExportThis};
class a{constructor(b){this.name_=b}console(){console.log(this.name_)}}export{a as ExportThis}
2 changes: 1 addition & 1 deletion test/provided-externs/fixtures/class.esm.es5.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
function a(b){this.name_=b}a.prototype.console=function(){console.log(this.name_)};export{a as ExportThis};
function a(b){this.name_=b}a.prototype.console=function(){console.log(this.name_)};export{a as ExportThis}

0 comments on commit 2bd7ec7

Please sign in to comment.