Skip to content
This repository has been archived by the owner on Apr 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5 from github/qltest-testing
Browse files Browse the repository at this point in the history
Get qlTest to work
  • Loading branch information
erik-krogh authored May 26, 2021
2 parents f351100 + f916aa9 commit 44311e2
Show file tree
Hide file tree
Showing 5 changed files with 528 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ql/src/ide-contextual-queries/localDefinitions.ql
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
*/

import codeql.IDEContextual
import codeql_ql.AST
import codeql_ql.ast.internal.TreeSitter::Generated

external string selectedSourceFile();

from AstNode e, Variable def, string kind
where
e = def.getAnAccess() and
none() and // e = def.getAnAccess() and // TODO: Get binding to work.
kind = "local variable" and
e.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile())
select e, def, kind
5 changes: 2 additions & 3 deletions ql/src/ide-contextual-queries/localReferences.ql
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
*/

import codeql.IDEContextual
import codeql_ql.AST
import codeql_ql.ast.Variable
import codeql_ql.ast.internal.TreeSitter::Generated

external string selectedSourceFile();

from AstNode e, Variable def, string kind
where
e = def.getAnAccess() and
none() and // e = def.getAnAccess() and // TODO: Get binding to work.
kind = "local variable" and
def.getLocation().getFile() = getFileBySourceArchiveName(selectedSourceFile())
select e, def, kind
11 changes: 11 additions & 0 deletions ql/test/printAst/Foo.qll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import javascript

class Foo extends @bar {
Foo() { 1 = 2 }

string toString() { result = "Foo" }
}

query predicate foo(Foo f) {
f = rank[2](Foo inner | inner.toString() = "foo" | inner order by inner.toString())
}
Loading

0 comments on commit 44311e2

Please sign in to comment.