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

The compile result with es6 module is not equal to TypeScript and Babel. #2139

Open
hstarorg opened this issue Jun 25, 2017 · 2 comments
Open

Comments

@hstarorg
Copy link

Like these codes:

// lib.js
export let c = {
  name: 'Hello'
};

export function ins() {
  return c.name
};

export function reset() {
  c = {
    name: 'Hello'
  };
};
import { c, ins, reset } from './lib';

c.name = '222';

console.log(c);
console.log(ins());

reset();
console.log(ins());
console.log(c);

When execute index.js that use babel or TypeScript compiled will print

{ name: '222' }
222
Hello
{ name: 'Hello' }

But use traceur, that will print

{ name: '222' }
222
Hello
{ name: '222' }

Would you tell us, which compiler is compile right?

@arv
Copy link
Collaborator

arv commented Jun 25, 2017

The expected output is what Babel outputs. Traceur should output the same thing. We have tests for that. What options are you compiling with?

@hstarorg
Copy link
Author

Use the defaults compiling options.

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

No branches or pull requests

2 participants