Title: Javascript should support property assignments on `exports`, even when aliased · Issue #22436 · microsoft/TypeScript · GitHub
Open Graph Title: Javascript should support property assignments on `exports`, even when aliased · Issue #22436 · microsoft/TypeScript
X Title: Javascript should support property assignments on `exports`, even when aliased · Issue #22436 · microsoft/TypeScript
Description: // @allowJs: true // @checkJs: true // @noEmit: true // @Filename: semver.js exports = module.exports = C exports.f = n => n + 1 function C() { this.p = 1 } // @filename: index.js const C = require("./semver") var two = C.f(1) var c = ne...
Open Graph Description: // @allowJs: true // @checkJs: true // @noEmit: true // @Filename: semver.js exports = module.exports = C exports.f = n => n + 1 function C() { this.p = 1 } // @filename: index.js const C = require...
X Description: // @allowJs: true // @checkJs: true // @noEmit: true // @Filename: semver.js exports = module.exports = C exports.f = n => n + 1 function C() { this.p = 1 } // @filename: index.js const C = requ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/22436
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Javascript should support property assignments on `exports`, even when aliased","articleBody":"```ts\r\n// @allowJs: true\r\n// @checkJs: true\r\n// @noEmit: true\r\n// @Filename: semver.js\r\nexports = module.exports = C\r\nexports.f = n => n + 1\r\nfunction C() {\r\n this.p = 1\r\n}\r\n// @filename: index.js\r\nconst C = require(\"./semver\")\r\nvar two = C.f(1)\r\nvar c = new C\r\n```\r\n\r\n**Expected behavior:**\r\nIn index.js, `f` should be a member of `C`.\r\n\r\n**Actual behavior:**\r\nIt is not.\r\n\r\nNote that if you assign to C, `f` *is* visible, but only if the assignment occurs after `function C () { ... }`. But that's a separate bug.","author":{"url":"https://github.com/sandersn","@type":"Person","name":"sandersn"},"datePublished":"2018-03-09T16:17:16Z","url":"https://github.com/microsoft/TypeScript/issues/22436"}
| 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:8c5b6e25-91b4-ddab-e5eb-0a631ca73d05 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CAE2:3CBB3E:1C89259:245D3EB:6B019EA3 |
| html-safe-nonce | 2f98f1b6a935a9518c21a983bae3efc2ab7e25411db2d232122e2fd0eb1ad461 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUUyOjNDQkIzRToxQzg5MjU5OjI0NUQzRUI6NkIwMTlFQTMiLCJ2aXNpdG9yX2lkIjoiNTAzOTM3Nzc3MjYzNjY0Mjk3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a74a9560e0bdb32ca2f4f13fcf1b5e5964120bb8e7363261c77b4e947881d7fc |
| hovercard-subject-tag | issue:303894992 |
| 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/22436/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a4f29ef3ac3965d8a11e6da2a556622b1102e2808d126feb97b8e6543b330a1d/microsoft/TypeScript/issues/22436 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a4f29ef3ac3965d8a11e6da2a556622b1102e2808d126feb97b8e6543b330a1d/microsoft/TypeScript/issues/22436 |
| og:image:alt | // @allowJs: true // @checkJs: true // @noEmit: true // @Filename: semver.js exports = module.exports = C exports.f = n => n + 1 function C() { this.p = 1 } // @filename: index.js const C = require... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sandersn |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width