GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — When source file is redirected, set the prototype correctly in node factory by sheetalkamat · Pull Request #48862 · microsoft/TypeScript

Conversation

@sheetalkamat

@sheetalkamat Sheetal Nandi (sheetalkamat) commented Apr 27, 2022

Copy link
Copy Markdown
Member

Fixes #48039

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sheetalkamat
When source file is redirected, set the prototype correctly in node f…
a5798f4
…actory

Fixes #48039
@typescript-bot TypeScript Bot (typescript-bot) assigned Sheetal Nandi (sheetalkamat) Apr 27, 2022
@typescript-bot TypeScript Bot (typescript-bot) added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Apr 27, 2022
@sheetalkamat
Sheetal Nandi (sheetalkamat) requested review from Ron Buckton (rbuckton) and Wesley Wigham (weswigham) April 27, 2022 19:07
@sheetalkamat Sheetal Nandi (sheetalkamat) mentioned this pull request Apr 27, 2022
fix: clone redirected SourceFile's prototype #44554
Closed
@merceyz

Kristoffer K. (merceyz) commented Apr 27, 2022

Copy link
Copy Markdown

This should also close #41717 since #44554 was closed in favour of this one.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser) reviewed May 3, 2022
View reviewed changes
Comment thread src/compiler/factory/nodeFactory.ts
libReferences: readonly FileReference[]
) {
const node = baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile) as Mutable<SourceFile>;
const node = (source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory.createBaseSourceFileNode(SyntaxKind.SourceFile)) as Mutable<SourceFile>;

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) May 3, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is setting the prototype pretty typical in factory functions and whatnot Ron Buckton (@rbuckton)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@rbuckton Ron Buckton (rbuckton) May 4, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally don't, but apparently we use Object.create in program.ts for redirected source files.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
rbuckton
Ron Buckton (rbuckton) approved these changes May 4, 2022
View reviewed changes

@rbuckton Ron Buckton (rbuckton) left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned with the fact redirection uses Object.create to wrap an existing source file because its easily overlooked. However, since this is already an existing behavior this change seems fine.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sheetalkamat
Sheetal Nandi (sheetalkamat) merged commit c8ec855 into main May 4, 2022
@sheetalkamat
Sheetal Nandi (sheetalkamat) deleted the redirectTs branch May 4, 2022 15:59
@sheetalkamat Sheetal Nandi (sheetalkamat) mentioned this pull request May 5, 2022
Cannot read property 'length' of undefined in v4 version #41717
Closed
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) DanielRosenwasser left review comments
@weswigham Wesley Wigham (weswigham) Awaiting requested review from weswigham
+1 more reviewer
@rbuckton Ron Buckton (rbuckton) rbuckton approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@sheetalkamat Sheetal Nandi (sheetalkamat)

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cannot read property 'get' of undefined – file.pragmas.get("jsximportsource") in getJSXImplicitImportBase

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sheetalkamat @merceyz @DanielRosenwasser @rbuckton @typescript-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.