Skip to content

JS: Mark AngularJS $location as client-side remote flow source #19587

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

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented May 27, 2025

No description provided.

@asgerf asgerf added the no-change-note-required This PR does not need a change note label May 27, 2025
@github-actions github-actions bot added the JS label May 27, 2025
@asgerf asgerf marked this pull request as ready for review June 2, 2025 12:04
@Copilot Copilot AI review requested due to automatic review settings June 2, 2025 12:04
@asgerf asgerf requested a review from a team as a code owner June 2, 2025 12:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the AngularJS $location handler to be recognized as a client-side remote flow source and differentiates query vs. fragment usage.

  • Switch base class from RemoteFlowSource to ClientSideRemoteFlowSource
  • Introduce a kind field to distinguish query (search) vs. fragment (hash)
  • Override getKind() to expose the new kind

private class LocationFlowSource extends RemoteFlowSource instanceof DataFlow::MethodCallNode {
private class LocationFlowSource extends ClientSideRemoteFlowSource instanceof DataFlow::MethodCallNode
{
private ClientSideRemoteFlowKind kind;
Copy link
Preview

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

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

The kind field is never assigned, so calls to kind.isQuery() or kind.isFragment() will fail. Assign kind = ClientSideRemoteFlowKind.Query when m == "search" and kind = ClientSideRemoteFlowKind.Fragment when m == "hash`.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@Napalys Napalys left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@asgerf asgerf merged commit 9ea4410 into github:main Jun 3, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JS no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants