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 {
466466 private class ImmutableArrayTransformStep extends TaintTracking:: SharedTaintStep {
467467 override predicate heapStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
468468 exists ( DataFlow:: MethodCallNode call |
469- call .getMethodName ( ) = "toSorted" and
469+ call .getMethodName ( ) in [ "toSorted" , "toReversed" ] and
470470 pred = call .getReceiver ( ) and
471471 succ = call
472472 )
Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ typeInferenceMismatch
236236| tst.js:2:13:2:20 | source() | tst.js:61:10:61:20 | x.reverse() |
237237| tst.js:2:13:2:20 | source() | tst.js:63:10:63:21 | x.toSorted() |
238238| 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 |
239241| xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text |
240242| xml.js:12:17:12:24 | source() | xml.js:13:14:13:19 | result |
241243| 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) {};
333333 */
334334Array . prototype . reverse = function ( ) { } ;
335335
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+
336345/**
337346 * Removes the first element from an array and returns that element. This
338347 * method changes the length of the array.
You can’t perform that action at this time.
0 commit comments