Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Redefining live function & class bindings #1943

Closed
Andarist opened this issue Feb 4, 2018 · 1 comment · Fixed by #1949
Closed

[bug] Redefining live function & class bindings #1943

Andarist opened this issue Feb 4, 2018 · 1 comment · Fixed by #1949

Comments

@Andarist
Copy link
Member

Andarist commented Feb 4, 2018

REPL url

Input

export function foo() { }
foo = 'bar'

expected output

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

function foo() { }
exports.foo = foo;
exports.foo = 'bar';

actual output

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

function exports.foo() { }
exports.foo = 'bar';

From what I see rollup@0.49 hadnt this bug, it had different one though - wrong value was preserved on the exports.

I've found this when experimenting with experimentalCodeSplitting which caused babelHelpers.extends to be put in chunk1.js and it is implemented in this "redefining" style (to support uglifyjs DCE) which broke my build.

@lukastaegert
Copy link
Member

As I'm currently reworking larger parts of the rendering logic I'll have a look at this one as well.

lukastaegert added a commit that referenced this issue Feb 7, 2018
lukastaegert added a commit that referenced this issue Feb 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants