Skip to content

Commit 102ca77

Browse files
committed
Switch to getLocation() in DataFlowCall
1 parent ecf418b commit 102ca77

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

javascript/ql/lib/semmle/javascript/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -478,11 +478,7 @@ class DataFlowCall extends TDataFlowCall {
478478
this = MkSummaryCall(enclosingCallable, receiver)
479479
}
480480

481-
predicate hasLocationInfo(
482-
string filepath, int startline, int startcolumn, int endline, int endcolumn
483-
) {
484-
none() // Overridden in subclass
485-
}
481+
Location getLocation() { none() } // Overridden in subclass
486482
}
487483

488484
private class OrdinaryCall extends DataFlowCall, MkOrdinaryCall {
@@ -498,11 +494,7 @@ private class OrdinaryCall extends DataFlowCall, MkOrdinaryCall {
498494

499495
override string toString() { result = node.toString() }
500496

501-
override predicate hasLocationInfo(
502-
string filepath, int startline, int startcolumn, int endline, int endcolumn
503-
) {
504-
node.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
505-
}
497+
override Location getLocation() { result = node.getLocation() }
506498
}
507499

508500
private class PartialCall extends DataFlowCall, MkPartialCall {
@@ -521,11 +513,7 @@ private class PartialCall extends DataFlowCall, MkPartialCall {
521513

522514
override string toString() { result = node.toString() + " (as partial invocation)" }
523515

524-
override predicate hasLocationInfo(
525-
string filepath, int startline, int startcolumn, int endline, int endcolumn
526-
) {
527-
node.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
528-
}
516+
override Location getLocation() { result = node.getLocation() }
529517
}
530518

531519
private class BoundCall extends DataFlowCall, MkBoundCall {
@@ -542,11 +530,7 @@ private class BoundCall extends DataFlowCall, MkBoundCall {
542530
result = node.toString() + " (as call with " + boundArgs + " bound arguments)"
543531
}
544532

545-
override predicate hasLocationInfo(
546-
string filepath, int startline, int startcolumn, int endline, int endcolumn
547-
) {
548-
node.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
549-
}
533+
override Location getLocation() { result = node.getLocation() }
550534
}
551535

552536
private class AccessorCall extends DataFlowCall, MkAccessorCall {
@@ -560,11 +544,7 @@ private class AccessorCall extends DataFlowCall, MkAccessorCall {
560544

561545
override string toString() { result = ref.toString() + " (as accessor call)" }
562546

563-
override predicate hasLocationInfo(
564-
string filepath, int startline, int startcolumn, int endline, int endcolumn
565-
) {
566-
ref.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
567-
}
547+
override Location getLocation() { result = ref.getLocation() }
568548
}
569549

570550
class SummaryCall extends DataFlowCall, MkSummaryCall {
@@ -598,11 +578,7 @@ private class ImpliedLambdaCall extends DataFlowCall, MkImpliedLambdaCall {
598578

599579
override string toString() { result = "[implied lambda call] " + function }
600580

601-
override predicate hasLocationInfo(
602-
string filepath, int startline, int startcolumn, int endline, int endcolumn
603-
) {
604-
function.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
605-
}
581+
override Location getLocation() { result = function.getLocation() }
606582

607583
override DataFlowCallable getEnclosingCallable() {
608584
result.asSourceCallable() = function.getEnclosingContainer()

0 commit comments

Comments
 (0)