Skip to content

Commit 1619a98

Browse files
committed
make the default registration/dispatch extend DataFlow::InvokeNode
1 parent 87bbbd6 commit 1619a98

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

javascript/ql/src/semmle/javascript/frameworks/EventEmitter.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ module EventRegistration {
128128
* first argument is a string describing which channel is registered, and the second
129129
* argument is the event handler callback.
130130
*/
131-
abstract class DefaultEventRegistration extends Range {
131+
abstract class DefaultEventRegistration extends Range, DataFlow::InvokeNode {
132132
override string getChannel() {
133-
this.(DataFlow::InvokeNode).getArgument(0).mayHaveStringValue(result)
133+
this.getArgument(0).mayHaveStringValue(result)
134134
}
135135

136136
override DataFlow::Node getReceivedItem(int i) {
137-
result = this.(DataFlow::InvokeNode).getABoundCallbackParameter(1, i)
137+
result = this.getABoundCallbackParameter(1, i)
138138
}
139139

140140
override DataFlow::Node getAReturnedValue() { none() }
@@ -190,13 +190,13 @@ module EventDispatch {
190190
* where the first argument is a string describing the channel, and the `i`+1 argument
191191
* is the `i`th item sent to the event handler.
192192
*/
193-
abstract class DefaultEventDispatch extends Range {
193+
abstract class DefaultEventDispatch extends Range, DataFlow::InvokeNode {
194194
override string getChannel() {
195-
this.(DataFlow::InvokeNode).getArgument(0).mayHaveStringValue(result)
195+
this.getArgument(0).mayHaveStringValue(result)
196196
}
197197

198198
override DataFlow::Node getSentItem(int i) {
199-
result = this.(DataFlow::InvokeNode).getArgument(i + 1)
199+
result = this.getArgument(i + 1)
200200
}
201201

202202
override EventRegistration::Range getAReceiver() { this.getEmitter() = result.getEmitter() }

0 commit comments

Comments
 (0)