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

export {foo as default} results in a live binding #860

Closed
Rich-Harris opened this issue Aug 17, 2016 · 1 comment
Closed

export {foo as default} results in a live binding #860

Rich-Harris opened this issue Aug 17, 2016 · 1 comment

Comments

@Rich-Harris
Copy link
Contributor

See demo:

// main.js
import foo from './foo.js';
console.log( foo ); // expected 1, got 2

// foo.js
let foo = 1;
export { foo as default }; // `export default foo` works correctly
foo = 2;

This should log 1 but logs 2. Via #845

@Rich-Harris Rich-Harris changed the title export {default as foo} results in a live binding export {foo as default} results in a live binding Aug 17, 2016
Rich-Harris added a commit that referenced this issue Aug 17, 2016
Rich-Harris added a commit that referenced this issue Sep 18, 2016
Rich-Harris added a commit that referenced this issue Sep 18, 2016
Prevent `export {foo as default}` from creating a live binding
@guybedford
Copy link
Contributor

@Rich-Harris I don't think this is correct actually. It is only export default asdf that is not live as that is an expression form, but export { x as default } should be live like any other binding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants