Skip to content

Conversation

@merceyz
Copy link

@merceyz merceyz commented Jun 11, 2021

When cloneSourceFileWithChanges clones a SourceFile it doesn't climb the prototype chain causing it to clone SourceFiles created by createRedirectSourceFile incorrectly.

I tried to write a test but was unable to figure it out so going to need some assistance on that, tested on the commit before https://github.com/tophat/monodeploy/commit/b2d532d6f3b1e0686d2857d1195409149591b4eb to confirm that it works

cc @armanio123 - the assignee on #41717

Fixes #41717

@armanio123
Copy link
Contributor

@sandersn do you know how can we add a test for this scenario?

@sandersn
Copy link
Member

sandersn commented Jun 15, 2021

@rbuckton is the main author of nodeFactory and might have an idea of how to test this.

Some guesses: If you can repro this from a single invocation of tsc you might get away with a compiler test. You can recreate an entire project's files with the // @filename: x.ts directive, including tsconfig.
If it requires the build system, there are build-system unit tests somewhere. Look for PRs from @sheetalkamat since she has worked on that area a lot.

@sandersn sandersn requested review from armanio123 and rbuckton June 22, 2021 23:01
@joeblynch
Copy link

This fixes #41717 for me as well. Thanks for the fix!

@oreporan
Copy link

Hey - any chances of this going in? fixes my length of undefined bug!

@sheetalkamat
Copy link
Member

Closing this in favor of #48862

@merceyz merceyz deleted the merceyz/fix/clone-sourcefile branch October 30, 2022 15:54
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Cannot read property 'length' of undefined in v4 version

8 participants