mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
add support for delegating yield
This commit is contained in:
@@ -30,4 +30,24 @@
|
||||
} catch (e) {
|
||||
sink(e); // NOT OK
|
||||
}
|
||||
|
||||
function *delegating() {
|
||||
yield* delegate();
|
||||
}
|
||||
|
||||
function *delegate() {
|
||||
yield source;
|
||||
}
|
||||
|
||||
Array.from(delegating()).forEach(x => sink(x)); // NOT OK
|
||||
|
||||
function *delegating2() {
|
||||
yield* returnsTaint();
|
||||
}
|
||||
|
||||
function returnsTaint() {
|
||||
return source;
|
||||
}
|
||||
|
||||
Array.from(delegating2()).forEach(x => sink(x)); // OK
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user