Skip to content

Commit 007b079

Browse files
authored
Merge pull request #2636 from erik-krogh/NewSocketIO
Approved by esbena
2 parents bc88c41 + 1228d50 commit 007b079

16 files changed

+427
-362
lines changed

change-notes/1.24/analysis-javascript.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
- [react](https://www.npmjs.com/package/react)
1414
- [typeahead.js](https://www.npmjs.com/package/typeahead.js)
1515
- [Handlebars](https://www.npmjs.com/package/handlebars)
16+
- [Electron](https://electronjs.org/)
17+
- [Node.js](https://nodejs.org/)
18+
- [Socket.IO](https://socket.io/)
1619

1720
## New queries
1821

@@ -37,3 +40,4 @@
3740
## Changes to libraries
3841

3942
* The predicates `RegExpTerm.getSuccessor` and `RegExpTerm.getPredecessor` have been changed to reflect textual, not operational, matching order. This only makes a difference in lookbehind assertions, which are operationally matched backwards. Previously, `getSuccessor` would mimick this, so in an assertion `(?<=ab)` the term `b` would be considered the predecessor, not the successor, of `a`. Textually, however, `a` is still matched before `b`, and this is the order we now follow.
43+
* An extensible model of the `EventEmitter` pattern has been implemented.

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ module EventRegistration {
117117

118118
abstract DataFlow::Node getReceivedItem(int i);
119119

120-
abstract DataFlow::Node getAReturnedValue();
120+
DataFlow::Node getAReturnedValue() { none() }
121121

122-
abstract EventDispatch::Range getAReturnDispatch();
122+
EventDispatch::Range getAReturnDispatch() { none() }
123123
}
124124

125125
/**
@@ -136,10 +136,6 @@ module EventRegistration {
136136
override DataFlow::Node getReceivedItem(int i) {
137137
result = this.getABoundCallbackParameter(1, i)
138138
}
139-
140-
override DataFlow::Node getAReturnedValue() { none() }
141-
142-
override EventDispatch::Range getAReturnDispatch() { none() }
143139
}
144140
}
145141

@@ -227,3 +223,4 @@ private class EventEmitterTaintStep extends DataFlow::AdditionalFlowStep {
227223
succ = dispatch
228224
}
229225
}
226+

0 commit comments

Comments
 (0)