René's URL Explorer Experiment


Title: ES5 class rewriting incompatible with frozen intrinsics · Issue #43450 · microsoft/TypeScript · GitHub

Open Graph Title: ES5 class rewriting incompatible with frozen intrinsics · Issue #43450 · microsoft/TypeScript

X Title: ES5 class rewriting incompatible with frozen intrinsics · Issue #43450 · microsoft/TypeScript

Description: Bug Report When TSC targets ES5, classes that extend other classes generate JS that throws a Cannot assign to read only property 'constructor' of object TypeError when the intrinsics, particularly the Function.prototype, are frozen. This...

Open Graph Description: Bug Report When TSC targets ES5, classes that extend other classes generate JS that throws a Cannot assign to read only property 'constructor' of object TypeError when the intrinsics, particularly ...

X Description: Bug Report When TSC targets ES5, classes that extend other classes generate JS that throws a Cannot assign to read only property 'constructor' of object TypeError when the intrinsics, parti...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/43450

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ES5 class rewriting incompatible with frozen intrinsics","articleBody":"# Bug Report\r\n\r\nWhen TSC targets ES5, classes that extend other classes generate JS that throws a `Cannot assign to read only property 'constructor' of object` TypeError when the intrinsics, particularly the `Function.prototype`, are frozen. This affects programs that are freezing their intrinsics to protect against supply chain attacks, particularly using SES.\r\n\r\n### 🔎 Search Terms\r\n\r\n* constructor\r\n* frozen\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nI identified this issue in the published code of `external-editor` 3.1.0, which is using TypeScript 3.5.2 https://github.com/mrkmg/node-external-editor/blob/e1070a8295b8ebbafa7b29802ae0e2da0fad47c0/tsconfig.json\r\n\r\nIn the playground, the output is consistent for the very oldest and very newest versions of TypeScript when targeting ES5.\r\n\r\n### ⏯ Playground Link\r\n\r\n[Playground link with relevant code](https://www.typescriptlang.org/play?target=1&ts=4.2.3#code/PIIwVgpgxgLgdAMwE4QgLwgCgGIFcB2sAlgPb4CUA3AFCiSyIrpZ6Eyn5wAOSJMfATy4Qq1KABsAhgGdpAAmwkScgN7U5GuVDLSYSXLBJJM5Ves0BfalYkz5AIUlI5EAB4wI+ACbzFytZpaOnoG-MamAZbWQA)\r\n\r\n### 💻 Code\r\n\r\n```ts\r\nObject.freeze(Function);\r\nObject.freeze(Function.prototype);\r\nclass Foo {\r\n    constructor() {\r\n    }\r\n}\r\nclass Bar extends Foo {\r\n    constructor() {\r\n    }\r\n}\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nThis code throws an exception like:\r\n\r\n`TypeError: Cannot assign to read only property 'constructor' of object ''`\r\n\r\n### 🙂 Expected behavior\r\n\r\nThis should not throw an exception. This can be achieved by using `Object.defineProperty(prototype, 'constructor', {value: constructor})` instead of `prototype.constructor = constructor`. This is a symptom of the so-called property override mistake, in the design of ES5.","author":{"url":"https://github.com/kriskowal","@type":"Person","name":"kriskowal"},"datePublished":"2021-03-30T23:22:59Z","url":"https://github.com/microsoft/TypeScript/issues/43450"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f880d1aa-257b-5e32-df68-b8a482b09b61
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDD6E:266B67:4EB44C:67F590:6B017A03
html-safe-nonceedfa728592598693387228b87b88a45daefc166b12c21ffb9560ab5e73a3cc2d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDZFOjI2NkI2Nzo0RUI0NEM6NjdGNTkwOjZCMDE3QTAzIiwidmlzaXRvcl9pZCI6IjM0MDM0Mzg3OTU2MDgxMjgwMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacccd41addfc07a29cad3a66e280bdf9181e8b5485f8122322d22f2f2347aed9da
hovercard-subject-tagissue:845451234
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/43450/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0cb8b146a0ae85343f9660add65cdfea1c5e3ec9c5a25b4222970c5cdc37658d/microsoft/TypeScript/issues/43450
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0cb8b146a0ae85343f9660add65cdfea1c5e3ec9c5a25b4222970c5cdc37658d/microsoft/TypeScript/issues/43450
og:image:altBug Report When TSC targets ES5, classes that extend other classes generate JS that throws a Cannot assign to read only property 'constructor' of object TypeError when the intrinsics, particularly ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekriskowal
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/43450#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F43450
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F43450
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/43450
Reloadhttps://github.com/microsoft/TypeScript/issues/43450
Reloadhttps://github.com/microsoft/TypeScript/issues/43450
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/43450
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/43450
ES5 class rewriting incompatible with frozen intrinsicshttps://github.com/microsoft/TypeScript/issues/43450#top
https://github.com/rbuckton
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/kriskowal
Kris Kowal (kriskowal)https://github.com/kriskowal
on Mar 30, 2021https://github.com/microsoft/TypeScript/issues/43450#issue-845451234
https://github.com/mrkmg/node-external-editor/blob/e1070a8295b8ebbafa7b29802ae0e2da0fad47c0/tsconfig.jsonhttps://github.com/mrkmg/node-external-editor/blob/e1070a8295b8ebbafa7b29802ae0e2da0fad47c0/tsconfig.json
Playground link with relevant codehttps://www.typescriptlang.org/play?target=1&ts=4.2.3#code/PIIwVgpgxgLgdAMwE4QgLwgCgGIFcB2sAlgPb4CUA3AFCiSyIrpZ6Eyn5wAOSJMfATy4Qq1KABsAhgGdpAAmwkScgN7U5GuVDLSYSXLBJJM5Ves0BfalYkz5AIUlI5EAB4wI+ACbzFytZpaOnoG-MamAZbWQA
https://github.com/erights
Mark S. Miller (erights)https://github.com/erights
on Mar 30, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-810645315
Daniel Rosenwasser (@DanielRosenwasser)https://github.com/DanielRosenwasser
Ron Buckton (@rbuckton)https://github.com/rbuckton
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Mar 30, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-810648665
https://github.com/kriskowal
Kris Kowal (kriskowal)https://github.com/kriskowal
on Mar 30, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-810649912
https://github.com/kriskowal
Kris Kowal (kriskowal)https://github.com/kriskowal
on Mar 30, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-810650064
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Mar 30, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-810653068
https://github.com/kriskowal
Kris Kowal (kriskowal)https://github.com/kriskowal
on Mar 31, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-810655203
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Mar 31, 2021https://github.com/microsoft/TypeScript/issues/43450#event-4531976295
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Ron Buckton (rbuckton)https://github.com/rbuckton
on Mar 31, 2021https://github.com/microsoft/TypeScript/issues/43450#event-4531976444
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Mar 31, 2021https://github.com/microsoft/TypeScript/issues/43450#event-4538024331
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Mar 31, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-811536167
https://github.com/rbuckton
Ron Buckton (rbuckton)https://github.com/rbuckton
on Apr 1, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-811593214
only be used on DOM nodeshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#internet_explorer_8_specific_notes
https://github.com/kumavis
kumavis (kumavis)https://github.com/kumavis
on Apr 12, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-817427192
Ron Buckton (@rbuckton)https://github.com/rbuckton
https://github.com/kumavis
kumavis (kumavis)https://github.com/kumavis
on Apr 12, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-817429191
https://github.com/erights
Mark S. Miller (erights)https://github.com/erights
on Jun 9, 2021https://github.com/microsoft/TypeScript/issues/43450#issuecomment-857397983
Ron Buckton (@rbuckton)https://github.com/rbuckton
#43450 (comment)https://github.com/microsoft/TypeScript/issues/43450#issuecomment-811593214
Richard Gibson (gibson042)https://github.com/gibson042
on Sep 4, 2025https://github.com/microsoft/TypeScript/issues/43450#event-19515066418
Support downleveling classes that extend frozen baseshttps://github.com/gibson042/TypeScript/commit/83f7970b1c1d8b24e6c884ab85ef3c485d01eceb
https://docs.github.com/articles/closing-issues-via-commit-messages
83f7970https://github.com/gibson042/TypeScript/commit/83f7970b1c1d8b24e6c884ab85ef3c485d01eceb
https://github.com/gibson042
Richard Gibson (gibson042)https://github.com/gibson042
on Sep 9, 2025https://github.com/microsoft/TypeScript/issues/43450#issuecomment-3270806847
#62397https://github.com/microsoft/TypeScript/pull/62397
my responsehttps://github.com/microsoft/TypeScript/pull/62397#issuecomment-3259178628
external-editorhttps://www.npmjs.com/package/external-editor
json-rpc-2.0https://www.npmjs.com/package/json-rpc-2.0
#62397https://github.com/microsoft/TypeScript/pull/62397
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 9, 2025https://github.com/microsoft/TypeScript/issues/43450#issuecomment-3271428020
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
not plannedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Sep 9, 2025https://github.com/microsoft/TypeScript/issues/43450#event-19594012207
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/43450
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/43450
Ron Buckton (rbuckton)https://github.com/rbuckton
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
Needs InvestigationThis issue needs a team member to investigate its status.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.