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

Add flag to emit modules in loose mode #6884

Merged
merged 3 commits into from
Feb 6, 2016
Merged

Conversation

mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Feb 3, 2016

Fix for #6819, adds a new flag --emitModulesInLooseMode to not emit "use strict" prologue in modules.

@@ -320,6 +320,11 @@ namespace ts {
name: "allowSyntheticDefaultImports",
type: "boolean",
description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
},
{
name: "emitModulesInLooseMode",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about emitNonStrictModules. "Loose mode" isn't a formally described thing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to avoid the double negative

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming from babel, "loose mode" means a set of operations are allowed to be performed not-to-spec (so that some corner cases don't function as expected) - TS output (by comparison) is always loose mode.

What about omitUseStrictPrologue or simply omitUseStrict?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, "loose" would be confusing.

I don't see a double negation with emitNonStrictModules, but Wesley's suggestions are good as well.

@@ -320,6 +320,11 @@ namespace ts {
name: "allowSyntheticDefaultImports",
type: "boolean",
description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking
},
{
name: "emitNonStrictModules",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noAutomaticUseStrict or implictUseStrictOnly to accommodate for classes.

@RyanCavanaugh
Copy link
Member

👍

mhegazy added a commit that referenced this pull request Feb 6, 2016
Add flag to emit modules in loose mode
@mhegazy mhegazy merged commit d27d10c into master Feb 6, 2016
@mhegazy mhegazy deleted the emitModulesInLooseMode branch February 6, 2016 00:51
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants