Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 01ad9ed

Browse files
author
Esben Sparre Andreasen
committed
JS: address review comments
1 parent 82fc8ae commit 01ad9ed

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

javascript/ql/src/Declarations/MissingThisQualifier.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ where maybeMissingThis(call, intendedTarget, gv)
5656
intendedTarget.getBody() = self and
5757
call.getEnclosingFunction() = self and
5858
call.flow().(DataFlow::CallNode).getNumArgument() > self.getNumParameter() and
59+
not self.hasRestParameter() and
5960
not self.usesArgumentsObject()
6061
)
6162
)

javascript/ql/test/query-tests/Declarations/MissingThisQualifier/MissingThisQualifier.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
| abstract-missing.ts:3:5:3:24 | setAudioProperties() | This call refers to a global function, and not the local method $@. | abstract-missing.ts:6:3:6:32 | abstrac ... ties(); | setAudioProperties |
2+
| indirection.js:7:9:7:20 | m("default") | This call refers to a global function, and not the local method $@. | indirection.js:2:5:4:5 | m() {\\n ... K\\n } | m |
23
| missing1.js:3:5:3:24 | setAudioProperties() | This call refers to a global function, and not the local method $@. | missing1.js:6:3:7:3 | setAudi ... (){\\n } | setAudioProperties |
34
| missing2.js:3:5:3:24 | setAudioProperties() | This call refers to a global function, and not the local method $@. | missing2.js:7:3:8:3 | static ... (){\\n } | setAudioProperties |
45
| namespaces-uses.ts:3:5:3:20 | globalFunction() | This call refers to a global function, and not the local method $@. | namespaces-uses.ts:2:3:4:3 | globalF ... OK\\n } | globalFunction |

javascript/ql/test/query-tests/Declarations/MissingThisQualifier/indirection.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@ class X {
22
m() {
33
m("default"); // OK
44
}
5+
6+
resty(...x) {
7+
m("default"); // NOT OK
8+
}
59
}

0 commit comments

Comments
 (0)