-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: Add overlay support to extractor #20307
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
asgerf
merged 6 commits into
github:main
from
asgerf:js/overlay-extract-and-discard-only
Sep 2, 2025
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6872f51
JS: Add metadata to dbscheme and stats
asgerf c1df8a9
JS: Overlay extraction support
asgerf 30baf0a
JS: Add overlayChangedFiles
asgerf ba585b8
JS: Add upgrade/downgrade scripts
asgerf 6783456
JS: Add discard predicates
asgerf 67a1c2f
Update javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java
asgerf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1,204 changes: 1,204 additions & 0 deletions
1,204
javascript/downgrades/76a926a00d5f3bc199c203a1437796fd7b2835ba/old.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
1,194 changes: 1,194 additions & 0 deletions
1,194
...script/downgrades/76a926a00d5f3bc199c203a1437796fd7b2835ba/semmlecode.javascript.dbscheme
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
javascript/downgrades/76a926a00d5f3bc199c203a1437796fd7b2835ba/upgrade.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
description: downgrade overlay relations | ||
compatibility: full | ||
|
||
databaseMetadata.rel: delete | ||
overlayChangedFiles.rel: delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
javascript/extractor/src/com/semmle/js/extractor/OverlayChanges.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.semmle.js.extractor; | ||
|
||
import java.util.List; | ||
|
||
public class OverlayChanges { | ||
public List<String> changes; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
private import javascript | ||
|
||
/** Holds if the database is an overlay. */ | ||
overlay[local] | ||
private predicate isOverlay() { databaseMetadata("isOverlay", "true") } | ||
|
||
overlay[local] | ||
private string getFileFromEntity(@locatable node) { | ||
exists(@location loc, @file file | | ||
hasLocation(node, loc) and | ||
locations_default(loc, file, _, _, _, _) and | ||
files(file, result) | ||
) | ||
} | ||
|
||
/** Holds if `file` was changed or deleted in the overlay. */ | ||
overlay[local] | ||
private predicate discardFile(string file) { isOverlay() and overlayChangedFiles(file) } | ||
|
||
/** Holds if `node` is in the `file` and is part of the overlay base database. */ | ||
overlay[local] | ||
private predicate discardableEntity(string file, @locatable node) { | ||
not isOverlay() and file = getFileFromEntity(node) | ||
} | ||
|
||
/** Holds if `node` should be discarded, because it is part of the overlay base and is in a file that was also extracted as part of the overlay database. */ | ||
overlay[discard_entity] | ||
private predicate discardEntity(@locatable node) { | ||
exists(string file | discardableEntity(file, node) and discardFile(file)) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.