Skip to content

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Sep 4, 2025

Removes a dependency that is problematic for overlay locality. String literals were in fact already SourceNodes so this was mostly redundant. but we do need to treat template literals as SourceNodes as well

Copilot AI review requested due to automatic review settings September 4, 2025 07:40
@github-actions github-actions bot added the JS label Sep 4, 2025

This comment was marked as outdated.

@asgerf asgerf added the no-change-note-required This PR does not need a change note label Sep 4, 2025
String literals are already SourceNodes. But we need to add template literals as well
@asgerf asgerf force-pushed the js/remove-angularjs-string-special-case branch from b563681 to 5b0ef40 Compare September 4, 2025 09:06
Copilot AI review requested due to automatic review settings September 4, 2025 11:59
Copy link
Contributor

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 removes special handling for string literals in AngularJS code by eliminating a custom TrackStringsInAngularCode class that was redundant since string literals were already tracked as SourceNodes. The change ensures template literals are properly treated as source nodes across all JavaScript code.

  • Removes the TrackStringsInAngularCode class and associated helper predicates from AngularJS core
  • Adds TemplateLiteral to the main SourceNode::Range implementation to ensure consistent tracking
  • Updates test expectations to reflect template literals now being properly recognized as source nodes

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
javascript/ql/lib/semmle/javascript/frameworks/AngularJS/AngularJSCore.qll Removes custom string tracking class and helper predicates that were redundant
javascript/ql/lib/semmle/javascript/dataflow/Sources.qll Adds TemplateLiteral to the main SourceNode implementation
javascript/ql/test/library-tests/DataFlow/tests.expected Updates test expectations to include template literals as tracked source nodes

@asgerf
Copy link
Contributor Author

asgerf commented Sep 8, 2025

The failures in DCA are due to a problem with SARIF exports that is not related to this PR

@asgerf asgerf marked this pull request as ready for review September 8, 2025 13:00
@asgerf asgerf requested a review from a team as a code owner September 8, 2025 13:00
@asgerf asgerf merged commit 0752dbe into github:main Sep 8, 2025
15 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