Skip to content

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.

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.

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.

6 participants