限定在指定文件中搜索
import javascript
from MethodCallExpr call
where call.getFile().getBaseName() = "string-manipulations.js"
select call
递归寻找使用location的表达式
import javascript
Expr useLocation(Expr call) {
call.getAChildExpr().toString() = "location" and result = call
or call = useLocation(result.getAChildExpr())
}
from MethodCallExpr call, int i
where call.getFile().getBaseName() = "string-manipulations.js"
select call, useLocation(call.getArgument(i))