Skip to content

Only use 'use strict'; in amdjs and commonjs #2523

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

Merged
merged 1 commit into from
Feb 23, 2018

Conversation

ulrikstrid
Copy link
Contributor

ES6 modules are always strict so 'use strict'; unnecessary when using that as output. I'm not sure if this is a real problem as it will probably be removed by uglify or similar but that depends on if it is smart enough I guess.

http://www.ecma-international.org/ecma-262/6.0/#sec-strict-mode-code

Module code is always strict mode code.

I'm kind of new to this (coming here via ReasonML) so any pointers on how to do this better are appreciated.

@glennsl
Copy link
Contributor

glennsl commented Feb 16, 2018

Restarted CI for you. It seems to have a problem with getting stuck these days

let output_dir = Filename.dirname output_prefix in
P.string f L.strict_directive;
P.newline f ;
let output_dir = Filename.dirname output_prefix in
Copy link
Member

Choose a reason for hiding this comment

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

I am unclear how does this achieve the desired behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of outputting it on all files it's just amd and commonjs

@bobzhang bobzhang merged commit 2f3e494 into rescript-lang:master Feb 23, 2018
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

Successfully merging this pull request may close these issues.

3 participants