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

[Emit] Some import statements not emitted #46

mhegazy opened this issue Jul 17, 2014 · 1 comment

[Emit] Some import statements not emitted #46

mhegazy opened this issue Jul 17, 2014 · 1 comment


Copy link

@mhegazy mhegazy commented Jul 17, 2014

In tests/cases/compiler/privacyTopLevelInternalReferenceImportWithExport.ts:

Everything declaration of the form:




is not emitted.

In tests/cases/compiler/privacyTopLevelInternalReferenceImportWithoutExport.ts:

Everything declaration of the form:




is not emitted.

For both cases, used to emit:

var im_private_c_public = m_public . c_public ;

and the like

@mhegazy mhegazy added this to the TypeScript 1.1 milestone Jul 17, 2014
Copy link

@ahejlsberg ahejlsberg commented Jul 17, 2014

The only difference I see is that the new compiler doesn't generate an (otherwise unused) local variable for an exported import statement. Specifically, given:

export import a = b;

the old compiler would generate:

var a = b;
exports.a = a;

where the new compiler simply generates:

exports.a = b;

Both compilers rewrite all references to a into exports.a so the new scheme definitely seems better.

@ahejlsberg ahejlsberg closed this Jul 17, 2014
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants