René's URL Explorer Experiment


Title: Transforming class member with decorators throws · Issue #17384 · microsoft/TypeScript · GitHub

Open Graph Title: Transforming class member with decorators throws · Issue #17384 · microsoft/TypeScript

X Title: Transforming class member with decorators throws · Issue #17384 · microsoft/TypeScript

Description: TypeScript Version: 2.4.0 Code Can't use something that runs from "tsc" since it does not support transformers In a PropertyDeclaration visitor return ts.updateProperty( node, node.decorators[0], // assume we have 2 or more decorators......

Open Graph Description: TypeScript Version: 2.4.0 Code Can't use something that runs from "tsc" since it does not support transformers In a PropertyDeclaration visitor return ts.updateProperty( node, node.decorators[0], /...

X Description: TypeScript Version: 2.4.0 Code Can't use something that runs from "tsc" since it does not support transformers In a PropertyDeclaration visitor return ts.updateProperty( node, node.de...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Transforming class member with decorators throws","articleBody":"**TypeScript Version:**  2.4.0 \r\n\r\n**Code**\r\n\r\n> Can't use something that runs from \"tsc\" since it does not support transformers\r\n\r\nIn a `PropertyDeclaration` visitor\r\n```ts\r\nreturn ts.updateProperty(\r\n          node,\r\n          node.decorators[0], // assume we have 2 or more decorators...\r\n          node.modifiers,\r\n          node.name,\r\n          node.type,\r\n          node.initializer\r\n        );\r\n```\r\n\r\n**Expected behavior:**\r\nShould compile.\r\n\r\n**Actual behavior:**\r\nException is thrown `TypeError: Cannot read property 'kind' of undefined`\r\n\r\nThe exception is throw from [here](https://github.com/Microsoft/TypeScript/blob/194c2bc2ca806f5f1014113329e33207f683037c/src/compiler/utilities.ts#L1121)\r\n\r\n```ts\r\n    export function nodeCanBeDecorated(node: Node): boolean {\r\n        switch (node.kind) {\r\n            case SyntaxKind.ClassDeclaration:\r\n                // classes are valid targets\r\n                return true;\r\n\r\n            case SyntaxKind.PropertyDeclaration:\r\n                // property declarations are valid if their parent is a class declaration.\r\n                return node.parent.kind === SyntaxKind.ClassDeclaration;\r\n\r\n            case SyntaxKind.GetAccessor:\r\n            case SyntaxKind.SetAccessor:\r\n            case SyntaxKind.MethodDeclaration:\r\n                // if this method has a body and its parent is a class declaration, this is a valid target.\r\n                return (\u003cFunctionLikeDeclaration>node).body !== undefined\r\n                    && node.parent.kind === SyntaxKind.ClassDeclaration;\r\n\r\n            case SyntaxKind.Parameter:\r\n                // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target;\r\n                return (\u003cFunctionLikeDeclaration>node.parent).body !== undefined\r\n                    && (node.parent.kind === SyntaxKind.Constructor\r\n                        || node.parent.kind === SyntaxKind.MethodDeclaration\r\n                        || node.parent.kind === SyntaxKind.SetAccessor)\r\n                    && node.parent.parent.kind === SyntaxKind.ClassDeclaration;\r\n        }\r\n\r\n        return false;\r\n    }\r\n```\r\n\r\nTrying to reach `node.parent.kind` while `node.parent` is undefined, which is common to all \"synthesized\" nodes, i.e. transforming nodes.\r\n\r\n#### This is true to all other members... Parameter, MethodDeclaration, GetAccessor and SetAccessor\r\n\r\n","author":{"url":"https://github.com/shlomiassaf","@type":"Person","name":"shlomiassaf"},"datePublished":"2017-07-25T00:42:18Z","url":"https://github.com/microsoft/TypeScript/issues/17384"}

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:03dc04c4-7a57-6ebc-e19d-57632cb8ae5e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE9FA:1F65:18271C0:1EAD650:6B019BA2
html-safe-nonce0b5f26bdb125d3d1552be51b0072b8420718c8c12f6c64f41f9449fce987224d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUZBOjFGNjU6MTgyNzFDMDoxRUFENjUwOjZCMDE5QkEyIiwidmlzaXRvcl9pZCI6IjkxMzE0NTM5NTMxOTQ2OTU1ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7ea1d869ffabd0f67590df59b5bad4d0ce7d35546f974a7e7112cb149923f3b2
hovercard-subject-tagissue:245254010
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/17384/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e1dd66c2d05d80e487b4dd00705644520b26cd63a79b6c5709944c8b8a92f0b0/microsoft/TypeScript/issues/17384
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e1dd66c2d05d80e487b4dd00705644520b26cd63a79b6c5709944c8b8a92f0b0/microsoft/TypeScript/issues/17384
og:image:altTypeScript Version: 2.4.0 Code Can't use something that runs from "tsc" since it does not support transformers In a PropertyDeclaration visitor return ts.updateProperty( node, node.decorators[0], /...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameshlomiassaf
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/17384#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F17384
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%2F17384
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/17384
Reloadhttps://github.com/microsoft/TypeScript/issues/17384
Reloadhttps://github.com/microsoft/TypeScript/issues/17384
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/17384
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17384
#20314https://github.com/microsoft/TypeScript/pull/20314
Transforming class member with decorators throwshttps://github.com/microsoft/TypeScript/issues/17384#top
#20314https://github.com/microsoft/TypeScript/pull/20314
https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: APIRelates to the public API for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20API%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 2.7https://github.com/microsoft/TypeScript/milestone/56
https://github.com/shlomiassaf
Shlomi Assaf (shlomiassaf)https://github.com/shlomiassaf
on Jul 25, 2017https://github.com/microsoft/TypeScript/issues/17384#issue-245254010
herehttps://github.com/Microsoft/TypeScript/blob/194c2bc2ca806f5f1014113329e33207f683037c/src/compiler/utilities.ts#L1121
https://github.com/shlomiassaf
Shlomi Assaf (shlomiassaf)https://github.com/shlomiassaf
on Jul 25, 2017https://github.com/microsoft/TypeScript/issues/17384#issuecomment-317595716
this PRhttps://github.com/shlomiassaf/TypeScript/commit/7017fa2a0a8137279230f04b59a6ec89f6928331
Shlomi Assaf (shlomiassaf)https://github.com/shlomiassaf
on Jul 25, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1177174084
fix members decorator check with transformershttps://github.com/shlomiassaf/TypeScript/commit/57202448842b0e9be5bd004a6923f888e825e7b9
https://docs.github.com/articles/closing-issues-via-commit-messages
5720244https://github.com/shlomiassaf/TypeScript/commit/57202448842b0e9be5bd004a6923f888e825e7b9
https://github.com/tbosch
Tobias Bosch (tbosch)https://github.com/tbosch
on Aug 3, 2017https://github.com/microsoft/TypeScript/issues/17384#issuecomment-320086806
transformer_util.tshttps://github.com/angular/tsickle/blob/master/src/transformer_util.ts
Martin Probst (@mprobst)https://github.com/mprobst
Evan Martin (@evmar)https://github.com/evmar
Alex Eagle (@alexeagle)https://github.com/alexeagle
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
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 Aug 29, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1226590441
https://github.com/filipesilva
Filipe Silva (filipesilva)https://github.com/filipesilva
on Sep 15, 2017https://github.com/microsoft/TypeScript/issues/17384#issuecomment-329804455
Tobias Bosch (@tbosch)https://github.com/tbosch
#17551https://github.com/microsoft/TypeScript/issues/17551
#18051https://github.com/microsoft/TypeScript/pull/18051
#18051https://github.com/microsoft/TypeScript/pull/18051
https://github.com/shlomiassaf
Shlomi Assaf (shlomiassaf)https://github.com/shlomiassaf
on Nov 6, 2017https://github.com/microsoft/TypeScript/issues/17384#issuecomment-342128213
Filipe Silva (@filipesilva)https://github.com/filipesilva
#18051https://github.com/microsoft/TypeScript/pull/18051
angular/angular#20216https://github.com/angular/angular/issues/20216
Ron Buckton (@rbuckton)https://github.com/rbuckton
Shlomi Assaf (shlomiassaf)https://github.com/shlomiassaf
on Nov 6, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1327548752
attach parent in setOriginalNodehttps://github.com/shlomiassaf/TypeScript/commit/34c65ec2fcb75906ba47b4c2d3c86faa4cbc4c3c
34c65echttps://github.com/shlomiassaf/TypeScript/commit/34c65ec2fcb75906ba47b4c2d3c86faa4cbc4c3c
https://github.com/niveo
ALDINEY MENDES SANTOS (niveo)https://github.com/niveo
on Nov 28, 2017https://github.com/microsoft/TypeScript/issues/17384#issuecomment-347493137
typestack/class-transformer#108https://github.com/typestack/class-transformer/issues/108
Revin Roman (@rmrevin)https://github.com/rmrevin
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%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
on Nov 28, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1361936827
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Wesley Wigham (weswigham)https://github.com/weswigham
on Nov 28, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1361936968
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Domain: APIRelates to the public API for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20API%22
on Nov 28, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1361937024
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 2.7https://github.com/microsoft/TypeScript/milestone/56
on Nov 28, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1361937093
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Nov 28, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1362470216
Wesley Wigham (weswigham)https://github.com/weswigham
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#20314https://github.com/microsoft/TypeScript/pull/20314
on Nov 29, 2017https://github.com/microsoft/TypeScript/issues/17384#event-1362604712
https://github.com/niveo
ALDINEY MENDES SANTOS (niveo)https://github.com/niveo
on Dec 15, 2017https://github.com/microsoft/TypeScript/issues/17384#issuecomment-351977411
angular/angular-cli#8434https://github.com/angular/angular-cli/issues/8434
George Mavritsakis (@gmavritsakis)https://github.com/gmavritsakis
shlomiassaf/TypeScript@7017fa2https://github.com/shlomiassaf/TypeScript/commit/7017fa2
https://github.com/kirillgroshkov
Kirill Groshkov (kirillgroshkov)https://github.com/kirillgroshkov
on Jan 13, 2018https://github.com/microsoft/TypeScript/issues/17384#issuecomment-357452011
https://github.com/kirillgroshkov
Kirill Groshkov (kirillgroshkov)https://github.com/kirillgroshkov
on Jan 13, 2018https://github.com/microsoft/TypeScript/issues/17384#issuecomment-357456779
https://github.com/kirillgroshkov/angular-cli/blob/18f14d71bc5d73dba488f8fc1d08fd46d1d885f1/packages/%40angular/cli/bin/nghttps://github.com/kirillgroshkov/angular-cli/blob/18f14d71bc5d73dba488f8fc1d08fd46d1d885f1/packages/%40angular/cli/bin/ng
https://github.com/kirillgroshkov/angular-cli/commit/18f14d71bc5d73dba488f8fc1d08fd46d1d885f1https://github.com/kirillgroshkov/angular-cli/commit/18f14d71bc5d73dba488f8fc1d08fd46d1d885f1
https://github.com/togbyte
Jin Chun (togbyte)https://github.com/togbyte
on Jan 31, 2018https://github.com/microsoft/TypeScript/issues/17384#issuecomment-362096794
https://github.com/weswigham
Wesley Wigham (weswigham)https://github.com/weswigham
on Feb 1, 2018https://github.com/microsoft/TypeScript/issues/17384#issuecomment-362146937
https://github.com/filipesilva
Filipe Silva (filipesilva)https://github.com/filipesilva
on Feb 1, 2018https://github.com/microsoft/TypeScript/issues/17384#issuecomment-362196303
Wesley Wigham (@weswigham)https://github.com/weswigham
microsofthttps://github.com/microsoft
on Jul 3, 2018https://github.com/microsoft/TypeScript/issues/17384#event-1712801978
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/17384
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/17384
Wesley Wigham (weswigham)https://github.com/weswigham
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: APIRelates to the public API for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20API%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
TypeScript 2.7https://github.com/microsoft/TypeScript/milestone/56
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.