JS: make LocalObjects::isEscape aware of yield

This commit is contained in:
Esben Sparre Andreasen
2020-05-18 12:41:13 +02:00
parent 14664be467
commit a9ba6ac659
4 changed files with 14 additions and 0 deletions

View File

@@ -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"

View File

@@ -89,3 +89,9 @@
let bound = {};
bound::unknown();
});
(async function* f() {
yield* {
get p() { }
};
});

View File

@@ -0,0 +1,5 @@
async function* f() {
yield* {
get p() { }
};
}