@@ -26,7 +26,7 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
26
26
override Location getLocation ( ) { hasLocation ( this , result ) }
27
27
28
28
override File getFile ( ) {
29
- result = getLocation ( ) .getFile ( ) // Specialized for performance reasons
29
+ result = this . getLocation ( ) .getFile ( ) // Specialized for performance reasons
30
30
}
31
31
32
32
/** Gets the first token belonging to this element. */
@@ -76,7 +76,7 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
76
76
77
77
/** Gets the toplevel syntactic unit to which this element belongs. */
78
78
cached
79
- TopLevel getTopLevel ( ) { Stages:: Ast:: ref ( ) and result = getParent ( ) .getTopLevel ( ) }
79
+ TopLevel getTopLevel ( ) { Stages:: Ast:: ref ( ) and result = this . getParent ( ) .getTopLevel ( ) }
80
80
81
81
/**
82
82
* Gets the `i`th child node of this node.
@@ -85,10 +85,10 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
85
85
* change between versions of the extractor.
86
86
*/
87
87
ASTNode getChild ( int i ) {
88
- result = getChildExpr ( i ) or
89
- result = getChildStmt ( i ) or
88
+ result = this . getChildExpr ( i ) or
89
+ result = this . getChildStmt ( i ) or
90
90
properties ( result , this , i , _, _) or
91
- result = getChildTypeExpr ( i )
91
+ result = this . getChildTypeExpr ( i )
92
92
}
93
93
94
94
/** Gets the `i`th child statement of this node. */
@@ -101,22 +101,22 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
101
101
TypeExpr getChildTypeExpr ( int i ) { typeexprs ( result , _, this , i , _) }
102
102
103
103
/** Gets a child node of this node. */
104
- ASTNode getAChild ( ) { result = getChild ( _) }
104
+ ASTNode getAChild ( ) { result = this . getChild ( _) }
105
105
106
106
/** Gets a child expression of this node. */
107
- Expr getAChildExpr ( ) { result = getChildExpr ( _) }
107
+ Expr getAChildExpr ( ) { result = this . getChildExpr ( _) }
108
108
109
109
/** Gets a child statement of this node. */
110
- Stmt getAChildStmt ( ) { result = getChildStmt ( _) }
110
+ Stmt getAChildStmt ( ) { result = this . getChildStmt ( _) }
111
111
112
112
/** Gets the number of child nodes of this node. */
113
- int getNumChild ( ) { result = count ( getAChild ( ) ) }
113
+ int getNumChild ( ) { result = count ( this . getAChild ( ) ) }
114
114
115
115
/** Gets the number of child expressions of this node. */
116
- int getNumChildExpr ( ) { result = count ( getAChildExpr ( ) ) }
116
+ int getNumChildExpr ( ) { result = count ( this . getAChildExpr ( ) ) }
117
117
118
118
/** Gets the number of child statements of this node. */
119
- int getNumChildStmt ( ) { result = count ( getAChildStmt ( ) ) }
119
+ int getNumChildStmt ( ) { result = count ( this . getAChildStmt ( ) ) }
120
120
121
121
/** Gets the parent node of this node, if any. */
122
122
cached
@@ -126,7 +126,7 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
126
126
ControlFlowNode getFirstControlFlowNode ( ) { result = this }
127
127
128
128
/** Holds if this syntactic entity belongs to an externs file. */
129
- predicate inExternsFile ( ) { getTopLevel ( ) .isExterns ( ) }
129
+ predicate inExternsFile ( ) { this . getTopLevel ( ) .isExterns ( ) }
130
130
131
131
/**
132
132
* Holds if this is an ambient node that is not a `TypeExpr` and is not inside a `.d.ts` file
@@ -137,9 +137,9 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
137
137
cached
138
138
private predicate isAmbientInternal ( ) {
139
139
Stages:: Ast:: ref ( ) and
140
- getParent ( ) .isAmbientInternal ( )
140
+ this . getParent ( ) .isAmbientInternal ( )
141
141
or
142
- not isAmbientTopLevel ( getTopLevel ( ) ) and
142
+ not isAmbientTopLevel ( this . getTopLevel ( ) ) and
143
143
(
144
144
this instanceof ExternalModuleDeclaration
145
145
or
@@ -176,9 +176,9 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
176
176
*/
177
177
pragma [ inline]
178
178
predicate isAmbient ( ) {
179
- isAmbientInternal ( )
179
+ this . isAmbientInternal ( )
180
180
or
181
- isAmbientTopLevel ( getTopLevel ( ) )
181
+ isAmbientTopLevel ( this . getTopLevel ( ) )
182
182
or
183
183
this instanceof TypeExpr
184
184
}
@@ -211,11 +211,11 @@ class TopLevel extends @toplevel, StmtContainer {
211
211
predicate isMinified ( ) {
212
212
Stages:: Ast:: ref ( ) and
213
213
// file name contains 'min' (not as part of a longer word)
214
- getFile ( ) .getBaseName ( ) .regexpMatch ( ".*[^-._]*[-._]min([-._].*)?\\.\\w+" )
214
+ this . getFile ( ) .getBaseName ( ) .regexpMatch ( ".*[^-._]*[-._]min([-._].*)?\\.\\w+" )
215
215
or
216
216
exists ( int numstmt | numstmt = strictcount ( Stmt s | s .getTopLevel ( ) = this ) |
217
217
// there are more than two statements per line on average
218
- numstmt .( float ) / getNumberOfLines ( ) > 2 and
218
+ numstmt .( float ) / this . getNumberOfLines ( ) > 2 and
219
219
// and there are at least ten statements overall
220
220
numstmt >= 10
221
221
)
@@ -249,9 +249,9 @@ class TopLevel extends @toplevel, StmtContainer {
249
249
/** Gets the number of lines containing comments in this toplevel. */
250
250
int getNumberOfLinesOfComments ( ) { numlines ( this , _, _, result ) }
251
251
252
- override predicate isStrict ( ) { getAStmt ( ) instanceof StrictModeDecl }
252
+ override predicate isStrict ( ) { this . getAStmt ( ) instanceof StrictModeDecl }
253
253
254
- override ControlFlowNode getFirstControlFlowNode ( ) { result = getEntry ( ) }
254
+ override ControlFlowNode getFirstControlFlowNode ( ) { result = this . getEntry ( ) }
255
255
256
256
override string toString ( ) { result = "<toplevel>" }
257
257
}
@@ -348,7 +348,7 @@ class JavaScriptURL extends @javascript_url, CodeInAttribute { }
348
348
* </pre>
349
349
*/
350
350
class Externs extends TopLevel {
351
- Externs ( ) { isExterns ( ) }
351
+ Externs ( ) { this . isExterns ( ) }
352
352
}
353
353
354
354
/**
@@ -393,7 +393,7 @@ class StmtContainer extends @stmt_container, ASTNode {
393
393
StmtContainer getFunctionBoundary ( ) {
394
394
if this instanceof Function or this instanceof TopLevel
395
395
then result = this
396
- else result = getEnclosingContainer ( ) .getFunctionBoundary ( )
396
+ else result = this . getEnclosingContainer ( ) .getFunctionBoundary ( )
397
397
}
398
398
399
399
/** Gets a statement that belongs to this container. */
@@ -427,19 +427,19 @@ class StmtContainer extends @stmt_container, ASTNode {
427
427
*
428
428
* Empty toplevels do not have a start node.
429
429
*/
430
- ConcreteControlFlowNode getStart ( ) { successor ( getEntry ( ) , result ) }
430
+ ConcreteControlFlowNode getStart ( ) { successor ( this . getEntry ( ) , result ) }
431
431
432
432
/**
433
433
* Gets the entry basic block of this function, that is, the basic block
434
434
* containing the entry node of its CFG.
435
435
*/
436
- EntryBasicBlock getEntryBB ( ) { result = getEntry ( ) }
436
+ EntryBasicBlock getEntryBB ( ) { result = this . getEntry ( ) }
437
437
438
438
/**
439
439
* Gets the start basic block of this function, that is, the basic block
440
440
* containing the start node of its CFG.
441
441
*/
442
- BasicBlock getStartBB ( ) { result .getANode ( ) = getStart ( ) }
442
+ BasicBlock getStartBB ( ) { result .getANode ( ) = this . getStart ( ) }
443
443
444
444
/** Gets the scope induced by this toplevel or function, if any. */
445
445
Scope getScope ( ) { scopenodes ( this , result ) }
@@ -449,7 +449,7 @@ class StmtContainer extends @stmt_container, ASTNode {
449
449
*
450
450
* See Annex C of the ECMAScript language specification.
451
451
*/
452
- predicate isStrict ( ) { getEnclosingContainer ( ) .isStrict ( ) }
452
+ predicate isStrict ( ) { this . getEnclosingContainer ( ) .isStrict ( ) }
453
453
}
454
454
455
455
/**
0 commit comments