File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,12 @@ abstract class CdlObject extends JsonObject {
1414 exists ( Location loc , JsonValue locValue |
1515 loc = this .getLocation ( ) and
1616 locValue = this .getPropValue ( "$location" ) and
17+ // The path in the cds.json file is relative to the working directory used when running
18+ // the cds compile command. In our extractor, that's always the root of the repository,
19+ // so we can identify the entry in the `File` table by its relative path.
1720 path =
18- any ( File f |
19- f .getAbsolutePath ( )
20- .matches ( "%" + locValue .getPropValue ( "file" ) .getStringValue ( ) + ".json" )
21- ) .getAbsolutePath ( ) .regexpReplaceAll ( "\\.json$" , "" ) and
21+ any ( File f | f .getRelativePath ( ) = locValue .getPropValue ( "file" ) .getStringValue ( ) )
22+ .getAbsolutePath ( ) and
2223 if
2324 not exists ( locValue .getPropValue ( "line" ) ) and
2425 not exists ( locValue .getPropValue ( "col" ) )
You can’t perform that action at this time.
0 commit comments