Repository navigation
Fix mistaken slice delete in extractFromSymbol #65480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,7 +194,7 @@ func (e *symbolExtractor) extractFromSymbol(name string, symbol *ast.Symbol, mod | |
| for name, namedExport := range symbol.Parent().Exports().All() { | ||
| if name != ast.InternalSymbolNameExportStar { | ||
| idx := slices.Index(allExports, namedExport) | ||
| if idx >= 0 || shouldIgnoreSymbol(namedExport) { | ||
| if idx >= 0 { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It feels like the bug here is this was meant to be an
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, no, shouldIgnoreSymbol always returns false here
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, I guess this is actually a noop, but it looks like a bug due to the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think the PR is correct. I think this must have been the result of refactoring how the slice is built/modified. The logic is sound if you think of the condition as "should exclude this symbol" rather than "should delete this symbol." It seems like I should be able to come up with a test though. Let me try for a minute. |
||
| allExports = slices.Delete(allExports, idx, idx+1) | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.