Skip to content

Commit 6f19fc2

Browse files
committed
JS: Add isTypeUsed to avoid overpruning
1 parent 632cce2 commit 6f19fc2

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

javascript/ql/test/library-tests/frameworks/data/test.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
consistencyIssue
2-
| library-tests/frameworks/data/test.js:261 | expected an alert, but found none | NOT OK | |
32
taintFlow
43
| paramDecorator.ts:6:54:6:54 | x | paramDecorator.ts:7:10:7:10 | x |
54
| test.js:5:30:5:37 | source() | test.js:5:8:5:38 | testlib ... urce()) |
@@ -80,6 +79,7 @@ taintFlow
8079
| test.js:269:10:269:31 | this.ba ... ource() | test.js:269:10:269:31 | this.ba ... ource() |
8180
| test.js:272:6:272:40 | new MyS ... ource() | test.js:272:6:272:40 | new MyS ... ource() |
8281
| test.js:274:6:274:39 | testlib ... eName() | test.js:274:6:274:39 | testlib ... eName() |
82+
| test.js:277:8:277:31 | "danger ... .danger | test.js:277:8:277:31 | "danger ... .danger |
8383
isSink
8484
| test.js:54:18:54:25 | source() | test-sink |
8585
| test.js:55:22:55:29 | source() | test-sink |

javascript/ql/test/library-tests/frameworks/data/test.ext.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extensions:
1111
- ['testlib', 'Member[ParamDecoratorSource].DecoratedParameter', 'test-source']
1212
- ['testlib', 'Member[getSource].ReturnValue', 'test-source']
1313
- ['(testlib)', 'Member[parenthesizedPackageName].ReturnValue', 'test-source']
14+
- ['danger-constant', 'Member[danger]', 'test-source']
1415

1516
- addsTo:
1617
pack: codeql/javascript-all

javascript/ql/test/library-tests/frameworks/data/test.ql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ import testUtilities.ConsistencyChecking
33
import semmle.javascript.frameworks.data.internal.ApiGraphModels as ApiGraphModels
44

55
class TypeModelFromCodeQL extends ModelInput::TypeModel {
6+
override predicate isTypeUsed(string type) { type = "danger-constant" }
7+
68
override DataFlow::Node getASource(string type) {
79
type = "danger-constant" and
810
result.getStringValue() = "danger-constant"
911
}
1012
}
1113

12-
class SourceFromDangerConstant extends ModelInput::SourceModelCsv {
13-
override predicate row(string row) { row = "danger-constant;Member[danger];test-source" }
14-
}
15-
1614
class BasicTaintTracking extends TaintTracking::Configuration {
1715
BasicTaintTracking() { this = "BasicTaintTracking" }
1816

0 commit comments

Comments
 (0)