Title: __extends fails to inherit static symbols · Issue #7529 · microsoft/TypeScript · GitHub
Open Graph Title: __extends fails to inherit static symbols · Issue #7529 · microsoft/TypeScript
X Title: __extends fails to inherit static symbols · Issue #7529 · microsoft/TypeScript
Description: TypeScript Version: 1.8.7 Code // A self-contained demonstration of the problem follows... const test = Symbol('name'); class Foo { constructor() { console.log('Foo constructor'); } } Foo[test] = 'testing a symbol'; class Bar extends Foo...
Open Graph Description: TypeScript Version: 1.8.7 Code // A self-contained demonstration of the problem follows... const test = Symbol('name'); class Foo { constructor() { console.log('Foo constructor'); } } Foo[test] = '...
X Description: TypeScript Version: 1.8.7 Code // A self-contained demonstration of the problem follows... const test = Symbol('name'); class Foo { constructor() { console.log('Foo constructor'); }...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/7529
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"__extends fails to inherit static symbols","articleBody":"**TypeScript Version:** \n 1.8.7\n\n**Code**\n\n``` ts\n// A self-contained demonstration of the problem follows...\nconst test = Symbol('name');\n\nclass Foo {\n constructor() {\n console.log('Foo constructor');\n }\n}\n\nFoo[test] = 'testing a symbol';\n\nclass Bar extends Foo {\n constructor() {\n super();\n console.log('Bar constructor');\n }\n}\n\nlet b = new Bar();\nconsole.log(Bar[test]);\n```\n\n**Expected behaviour:**\nShould output\n\n```\nFoo constructor\nBar constructor\ntesting a symbol\n```\n\n**Actual behaviour:** \nActual output is\n\n```\nFoo constructor\nBar constructor\nundefined\n```\n\nThis is because the __extends helper uses `hasOwnProperty` to check for properties to be copied over. Symbols are not properties, so they are never copied.\n\nThis works correctly with native ES6 classes, and with Babel's _inherits helper (using Object.setPrototypeOf rather than copying properties manually).\n","author":{"url":"https://github.com/dpogue","@type":"Person","name":"dpogue"},"datePublished":"2016-03-15T22:22:23Z","url":"https://github.com/microsoft/TypeScript/issues/7529"}
| 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:27e6bb37-425d-bb9a-9003-f1d3f334acc1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA70:A20F9:8193FA:AEA9A8:6B00DD31 |
| html-safe-nonce | c1ed8e92b965db11cff88ccb7a9b805edfe4720614f2914a253c1e640589574b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTcwOkEyMEY5OjgxOTNGQTpBRUE5QTg6NkIwMEREMzEiLCJ2aXNpdG9yX2lkIjoiMTQzMzkyOTg5MDc1MDU4NjE2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 325c55439f955fc1e97f0562dde24e78cf8f83302b26cd4c1619c6aca843261f |
| hovercard-subject-tag | issue:141116115 |
| 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/7529/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2cd81617c74d8afaebcd448fe72a40baa62a43573436414eb9db30e01194ef13/microsoft/TypeScript/issues/7529 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2cd81617c74d8afaebcd448fe72a40baa62a43573436414eb9db30e01194ef13/microsoft/TypeScript/issues/7529 |
| og:image:alt | TypeScript Version: 1.8.7 Code // A self-contained demonstration of the problem follows... const test = Symbol('name'); class Foo { constructor() { console.log('Foo constructor'); } } Foo[test] = '... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dpogue |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width