Skip to content

Commit d689a55

Browse files
committed
Added test cases for TypedArray methods
1 parent e23ff9c commit d689a55

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ consistencyIssue
4343
| nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency |
4444
| stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency |
4545
| stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency |
46+
| typed-arrays.js:15 | expected an alert, but found none | NOT OK | Consistency |
47+
| typed-arrays.js:18 | expected an alert, but found none | NOT OK | Consistency |
48+
| typed-arrays.js:22 | expected an alert, but found none | NOT OK | Consistency |
4649
flow
4750
| access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x |
4851
| addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x |

javascript/ql/test/library-tests/TaintTracking/typed-arrays.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,15 @@ function test() {
99

1010
var arr = new Uint8Array(y.buffer, y.byteOffset, y.byteLength);
1111
sink(arr); // NOT OK
12+
13+
const z = new Uint8Array([1, 2, 3]);
14+
z.set(y, 3);
15+
sink(z); // NOT OK
16+
17+
const sub = y.subarray(1, 3)
18+
sink(sub); // NOT OK
19+
20+
const clone = new y.constructor(y.length);
21+
clone.set(y);
22+
sink(clone); // NOT OK
1223
}

0 commit comments

Comments
 (0)