Skip to content

Commit

Permalink
Merge branch 'system-semicolon'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed May 15, 2018
2 parents 2879bb7 + f318892 commit 14dbe39
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Fix an issue with namespaces containing reexports ([#2157](https://github.com/rollup/rollup/pull/2157))
* Fix an issue with wrong paths of relative external imports ([#2160](https://github.com/rollup/rollup/pull/2160))
* Fix an issue when using default exports and `interop: false` ([#2149](https://github.com/rollup/rollup/pull/2149))
* Fix in issue with invalid syntax in SystemJS output ([#2187](https://github.com/rollup/rollup/pull/2187))
* Fix an issue when tree-shaking call expressions and reassigned variables ([#2186](https://github.com/rollup/rollup/pull/2186))
* Fix file paths in source maps ([#2161](https://github.com/rollup/rollup/pull/2161))
* Fix wrong file name in error message ([#2137](https://github.com/rollup/rollup/pull/2137))
Expand Down
4 changes: 2 additions & 2 deletions src/ast/nodes/ExportDefaultDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class ExportDefaultDeclaration extends NodeBase {
}
return;
}
super.render(code, options);
this.declaration.render(code, options);
}

private renderNamedDeclaration(
Expand Down Expand Up @@ -158,7 +158,7 @@ export default class ExportDefaultDeclaration extends NodeBase {
`${this.context.varOrConst} ${this.variable.getName()} = ${systemBinding}`
);
if (systemBinding) {
code.appendRight(code.original[this.end - 1] === ';' ? this.end - 1 : this.end, ')');
code.appendLeft(code.original[this.end - 1] === ';' ? this.end - 1 : this.end, ')');
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions test/form/samples/system-semicolon/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
description: 'supports asi in system binding output',
options: {
output: {
format: 'system'
}
}
};
12 changes: 12 additions & 0 deletions test/form/samples/system-semicolon/_expected.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
System.register([], function (exports, module) {
'use strict';
return {
execute: function () {

var main = exports('default', typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {})

}
};
});
3 changes: 3 additions & 0 deletions test/form/samples/system-semicolon/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {}

0 comments on commit 14dbe39

Please sign in to comment.