File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
library-tests/TaintTracking
query-tests/NodeJS/DubiousImport Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -466,7 +466,7 @@ private module ArrayLibraries {
466
466
private class ImmutableArrayTransformStep extends TaintTracking:: SharedTaintStep {
467
467
override predicate heapStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
468
468
exists ( DataFlow:: MethodCallNode call |
469
- call .getMethodName ( ) = "toSorted" and
469
+ call .getMethodName ( ) in [ "toSorted" , "toReversed" ] and
470
470
pred = call .getReceiver ( ) and
471
471
succ = call
472
472
)
Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ typeInferenceMismatch
236
236
| tst.js:2:13:2:20 | source() | tst.js:61:10:61:20 | x.reverse() |
237
237
| tst.js:2:13:2:20 | source() | tst.js:63:10:63:21 | x.toSorted() |
238
238
| tst.js:2:13:2:20 | source() | tst.js:65:10:65:16 | xSorted |
239
+ | tst.js:2:13:2:20 | source() | tst.js:67:10:67:23 | x.toReversed() |
240
+ | tst.js:2:13:2:20 | source() | tst.js:69:10:69:18 | xReversed |
239
241
| xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text |
240
242
| xml.js:12:17:12:24 | source() | xml.js:13:14:13:19 | result |
241
243
| xml.js:23:18:23:25 | source() | xml.js:20:14:20:17 | attr |
Original file line number Diff line number Diff line change @@ -333,6 +333,15 @@ Array.prototype.push = function(var_args) {};
333
333
*/
334
334
Array . prototype . reverse = function ( ) { } ;
335
335
336
+ /**
337
+ * Returns a new array with the elements in reversed order.
338
+ *
339
+ * @this {{length: number}}
340
+ * @template T
341
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed
342
+ */
343
+ Array . prototype . toReversed = function ( ) { } ;
344
+
336
345
/**
337
346
* Removes the first element from an array and returns that element. This
338
347
* method changes the length of the array.
You can’t perform that action at this time.
0 commit comments