Title: target es2015 + module system + import used in object shorthand -> incorrect output · Issue #21057 · microsoft/TypeScript · GitHub
Open Graph Title: target es2015 + module system + import used in object shorthand -> incorrect output · Issue #21057 · microsoft/TypeScript
X Title: target es2015 + module system + import used in object shorthand -> incorrect output · Issue #21057 · microsoft/TypeScript
Description: TypeScript Version: 2.7.0-dev.20180107 Code // tsconfig.json { "compilerOptions": { "lib": ["es2015"], "module": "system", "outDir": "./dist", "target": "es2015" }, "include": ["./src/**/*"] } // index.ts import {x} from './x.js' const x...
Open Graph Description: TypeScript Version: 2.7.0-dev.20180107 Code // tsconfig.json { "compilerOptions": { "lib": ["es2015"], "module": "system", "outDir": "./dist", "target": "es2015" }, "include": ["./src/**/*"] } // i...
X Description: TypeScript Version: 2.7.0-dev.20180107 Code // tsconfig.json { "compilerOptions": { "lib": ["es2015"], "module": "system", "outDir": &quo...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/21057
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"target es2015 + module system + import used in object shorthand -> incorrect output","articleBody":"**TypeScript Version:** 2.7.0-dev.20180107\r\n\r\n**Code**\r\n\r\n```json\r\n// tsconfig.json\r\n{\r\n \"compilerOptions\": {\r\n \"lib\": [\"es2015\"],\r\n \"module\": \"system\",\r\n \"outDir\": \"./dist\",\r\n \"target\": \"es2015\"\r\n },\r\n \"include\": [\"./src/**/*\"]\r\n}\r\n```\r\n\r\n```ts\r\n// index.ts\r\nimport {x} from './x.js'\r\n\r\nconst x2 = {x} // `x` undefined\r\nconsole.log({x2})\r\n\r\nconst x3 = x\r\nconsole.log({x3})\r\n\r\n// same with default export/import\r\n```\r\n\r\n```ts\r\n// x.ts\r\nexport const x = 'X'\r\n```\r\n\r\n```js\r\n// index.js\r\nSystem.register([\"./x.js\"], function (exports_1, context_1) {\r\n \"use strict\";\r\n var __moduleName = context_1 && context_1.id;\r\n var x_js_1, x2, x3;\r\n return {\r\n setters: [\r\n function (x_js_1_1) {\r\n x_js_1 = x_js_1_1;\r\n }\r\n ],\r\n execute: function () {\r\n x2 = { x }; // `x` undefined\r\n console.log({ x2 });\r\n x3 = x_js_1.x;\r\n console.log({ x3 });\r\n // same with default export/import\r\n }\r\n };\r\n});\r\n```\r\n\r\n**Expected behavior:**\r\nImported values can be used with \"object shorthand\" es2015 syntax, when using the \"system\" module format.\r\n\r\n**Actual behavior:**\r\nIn index.js, `{x}` object shorthand is correctly left untranspiled, but `x` is undefined.\r\n ","author":{"url":"https://github.com/mpal9000","@type":"Person","name":"mpal9000"},"datePublished":"2018-01-07T15:17:02Z","url":"https://github.com/microsoft/TypeScript/issues/21057"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:0dce61e1-fa16-9e29-8867-10442be0faa0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8ADC:263885:1986383:20C59BC:6B03E605 |
| html-safe-nonce | 67b210382c50a44b49664352a8a7bc60bddbeaa8d22d2a86c6c27424ee7e53b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QURDOjI2Mzg4NToxOTg2MzgzOjIwQzU5QkM6NkIwM0U2MDUiLCJ2aXNpdG9yX2lkIjoiMTM4NDk2OTE3MzgxNTcyMTAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e836a3ebd269465171e947bf0baefb8c998f01259afb7b75f4b7f6b7456ac199 |
| hovercard-subject-tag | issue:286576156 |
| 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/21057/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9c5ec63045ac42844952c718983a7e244a93a845a8c6c69c037a3d8c679beca6/microsoft/TypeScript/issues/21057 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9c5ec63045ac42844952c718983a7e244a93a845a8c6c69c037a3d8c679beca6/microsoft/TypeScript/issues/21057 |
| og:image:alt | TypeScript Version: 2.7.0-dev.20180107 Code // tsconfig.json { "compilerOptions": { "lib": ["es2015"], "module": "system", "outDir": "./dist", "target": "es2015" }, "include": ["./src/**/*"] } // i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mpal9000 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width