Skip to content

Commit fa8736a

Browse files
author
Max Schaefer
committed
JavaScript: Introduce aliases for compatibility with other language libraries.
1 parent a7290e5 commit fa8736a

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

javascript/ql/src/javascript.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.
33
*/
44

5+
import semmle.javascript.Aliases
56
import semmle.javascript.AMD
67
import semmle.javascript.AST
78
import semmle.javascript.BasicBlocks
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Provides aliases for commonly used classes that have different names
3+
* in the QL libraries for other languages.
4+
*/
5+
6+
import javascript
7+
8+
class AndBitwiseExpr = BitAndExpr;
9+
class AndLogicalExpr = LogAndExpr;
10+
class ArrayAccess = IndexExpr;
11+
class AssignOp = CompoundAssignExpr;
12+
class Block = BlockStmt;
13+
class BoolLiteral = BooleanLiteral;
14+
class CaseStmt = Case;
15+
class ComparisonOperation = Comparison;
16+
class DoStmt = DoWhileStmt;
17+
class EqualityOperation = EqualityTest;
18+
class FieldAccess = DotExpr;
19+
class InstanceOfExpr = InstanceofExpr;
20+
class LabelStmt = LabeledStmt;
21+
class LogicalAndExpr = LogAndExpr;
22+
class LogicalNotExpr = LogNotExpr;
23+
class LogicalOrExpr = LogOrExpr;
24+
class Loop = LoopStmt;
25+
class MultilineComment = BlockComment;
26+
class OrBitwiseExpr = BitOrExpr;
27+
class OrLogicalExpr = LogOrExpr;
28+
class ParenthesisExpr = ParExpr;
29+
class ParenthesizedExpr = ParExpr;
30+
class RelationalOperation = RelationalComparison;
31+
class RemExpr = ModExpr;
32+
class SingleLineComment = LineComment;
33+
class SuperAccess = SuperExpr;
34+
class SwitchCase = Case;
35+
class ThisAccess = ThisExpr;
36+
class VariableAccess = VarAccess;
37+
class XorBitwiseExpr = XOrExpr;

0 commit comments

Comments
 (0)