Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

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

@hstarorg

Description

@hstarorg

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions