Title: Should the strict-mode status of a file be dependent on its external module status · Issue #4963 · microsoft/TypeScript · GitHub
Open Graph Title: Should the strict-mode status of a file be dependent on its external module status · Issue #4963 · microsoft/TypeScript
X Title: Should the strict-mode status of a file be dependent on its external module status · Issue #4963 · microsoft/TypeScript
Description: With #4811 merged we've decoupled ES6 module emit from the ES6 language level, allowing us to emit other module forms when targeting ES6. This brings up another interesting question - we parse all external modules in strict mode, ES6 or ...
Open Graph Description: With #4811 merged we've decoupled ES6 module emit from the ES6 language level, allowing us to emit other module forms when targeting ES6. This brings up another interesting question - we parse all ...
X Description: With #4811 merged we've decoupled ES6 module emit from the ES6 language level, allowing us to emit other module forms when targeting ES6. This brings up another interesting question - we parse ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/4963
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Should the strict-mode status of a file be dependent on its external module status","articleBody":"With #4811 merged we've decoupled ES6 module emit from the ES6 language level, allowing us to emit other module forms when targeting ES6. This brings up another interesting question - we parse _all_ external modules in strict mode, ES6 or not, when this is only a requirement for ES6 modules. Should we fix this and make the parse dependent on the module selection? Or should we emit `\"use strict\";` in non-ES6 forms so reality matches the parser? Even before #4811 we've actually had this wrong:\n\n``` ts\nimport * as foo from \"./foo\";\n\nwith (foo) {\n\n}\n```\n\nWe forbid the `with` as per strict mode, but we're emitting an amd module _without_ a `\"use strict\";` indicator. To be correct, when not targeting es6 modules, we should either disable strict mode when parsing or emit a `\"use strict\";`.\n","author":{"url":"https://github.com/weswigham","@type":"Person","name":"weswigham"},"datePublished":"2015-09-25T00:23:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/4963/TypeScript/issues/4963"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d5881c0-98a4-298f-3142-69fc34b118b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B692:3618EF:2EC826:3EF10A:6A6291EC |
| html-safe-nonce | 266ab90650d224c8b8d4adbd280423a9ae30f974c489b1fd6ac18b3771869335 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjkyOjM2MThFRjoyRUM4MjY6M0VGMTBBOjZBNjI5MUVDIiwidmlzaXRvcl9pZCI6IjM4MjI4MjY2NDUzNTY3MTI0MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0cf3cca349c5781e751e07d9faaadb87cabf3c385818f07916017f61071f72fb |
| hovercard-subject-tag | issue:108239575 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/4963/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dbc916fec456c57fb9aa42609197be861bafa2df0fea75b7bcc8093d2d872bbc/microsoft/TypeScript/issues/4963 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dbc916fec456c57fb9aa42609197be861bafa2df0fea75b7bcc8093d2d872bbc/microsoft/TypeScript/issues/4963 |
| og:image:alt | With #4811 merged we've decoupled ES6 module emit from the ES6 language level, allowing us to emit other module forms when targeting ES6. This brings up another interesting question - we parse all ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | weswigham |
| hostname | github.com |
| expected-hostname | github.com |
| None | ac2209d8cb6970a1bd08cb0a3f821d7166ac544c2ca1c87819c335bb84310ecd |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2fca8cd598678aaa64706088ad13b4e19177e108 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width