Skip to content

Commit bce06d3

Browse files
committed
add test that promisify is not imprecise
1 parent c49d508 commit bce06d3

File tree

1 file changed

+6
-0
lines changed
  • javascript/ql/test/query-tests/Security/CWE-089/untyped

1 file changed

+6
-0
lines changed

javascript/ql/test/query-tests/Security/CWE-089/untyped/redis.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ app.post('/documents/find', (req, res) => {
4444

4545
client.setAsync = promisify(client.set);
4646
const foo2 = client.setAsync(key, "value"); // NOT OK
47+
48+
client.unrelated = promisify(() => {});
49+
const foo3 = client.unrelated(key, "value"); // OK
50+
51+
const unrelated = promisify(client.foobar).bind(client);
52+
const foo4 = unrelated(key, "value"); // OK
4753
});

0 commit comments

Comments
 (0)