mirror of
https://github.com/github/codeql.git
synced 2025-12-24 12:46:34 +01:00
JS: make LocalObjects::isEscape aware of yield
This commit is contained in:
@@ -12,6 +12,8 @@ private predicate isEscape(DataFlow::Node escape, string cause) {
|
||||
or
|
||||
escape = any(DataFlow::FunctionNode fun).getAReturn() and cause = "return"
|
||||
or
|
||||
escape = any(YieldExpr yield).getOperand().flow() and cause = "yield"
|
||||
or
|
||||
escape = any(ThrowStmt t).getExpr().flow() and cause = "throw"
|
||||
or
|
||||
escape = any(GlobalVariable v).getAnAssignedExpr().flow() and cause = "global"
|
||||
|
||||
@@ -89,3 +89,9 @@
|
||||
let bound = {};
|
||||
bound::unknown();
|
||||
});
|
||||
|
||||
(async function* f() {
|
||||
yield* {
|
||||
get p() { }
|
||||
};
|
||||
});
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
async function* f() {
|
||||
yield* {
|
||||
get p() { }
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user