JS: Add spread step when bactracking in API graphs

This commit is contained in:
Asger Feldthaus
2021-01-25 13:00:15 +00:00
parent 9f2897b179
commit 2a3bc0f110
5 changed files with 30 additions and 0 deletions

View File

@@ -750,6 +750,18 @@ module API {
)
)
or
exists(ObjectExpr obj |
obj = trackDefNode(nd, t.continue()).asExpr() and
result =
obj.getAProperty()
.(SpreadProperty)
.getInit()
.(SpreadElement)
.getOperand()
.flow()
.getALocalSource()
)
or
t = defStep(nd, result)
}

View File

@@ -0,0 +1 @@
import ApiGraphs.VerifyAssertions

View File

@@ -0,0 +1,6 @@
{
"name": "spread",
"dependencies": {
"something": "*"
}
}

View File

@@ -0,0 +1,11 @@
const lib = require('something');
function f() {
return {
x: new Object() /* def (member x (parameter 0 (member m1 (member exports (module something))))) */
}
}
lib.m1({
...f()
})