mirror of
https://github.com/github/codeql.git
synced 2025-12-23 20:26:32 +01:00
renamed "hasDeclareKeyword" to "has_declare_keyword"
This commit is contained in:
@@ -46,7 +46,7 @@ public class DeclarationFlags {
|
||||
"hasProtectedKeyword",
|
||||
"isOptionalMember",
|
||||
"hasDefiniteAssignmentAssertion",
|
||||
"hasDeclareKeyword");
|
||||
"has_declare_keyword");
|
||||
|
||||
public static boolean isComputed(int flags) {
|
||||
return (flags & computed) != 0;
|
||||
|
||||
@@ -822,7 +822,7 @@ public class ASTExtractor {
|
||||
public Label visit(VariableDeclaration nd, Context c) {
|
||||
Label key = super.visit(nd, c);
|
||||
if (nd.hasDeclareKeyword()) {
|
||||
trapwriter.addTuple("hasDeclareKeyword", key);
|
||||
trapwriter.addTuple("has_declare_keyword", key);
|
||||
}
|
||||
visitAll(nd.getDeclarations(), key);
|
||||
return key;
|
||||
@@ -881,7 +881,7 @@ public class ASTExtractor {
|
||||
public Label visit(FunctionDeclaration nd, Context c) {
|
||||
Label key = super.visit(nd, c);
|
||||
if (nd.hasDeclareKeyword()) {
|
||||
trapwriter.addTuple("hasDeclareKeyword", key);
|
||||
trapwriter.addTuple("has_declare_keyword", key);
|
||||
}
|
||||
extractFunction(nd, key);
|
||||
emitStaticType(nd, key);
|
||||
@@ -1284,7 +1284,7 @@ public class ASTExtractor {
|
||||
public Label visit(ClassDeclaration nd, Context c) {
|
||||
Label lbl = super.visit(nd, c);
|
||||
if (nd.hasDeclareKeyword()) {
|
||||
trapwriter.addTuple("hasDeclareKeyword", lbl);
|
||||
trapwriter.addTuple("has_declare_keyword", lbl);
|
||||
}
|
||||
if (nd.hasAbstractKeyword()) {
|
||||
trapwriter.addTuple("isAbstractClass", lbl);
|
||||
@@ -1361,7 +1361,7 @@ public class ASTExtractor {
|
||||
nd.isInstantiated() ? IdContext.varAndNamespaceDecl : IdContext.namespaceDecl;
|
||||
visit(nd.getName(), lbl, -1, context);
|
||||
if (nd.hasDeclareKeyword()) {
|
||||
trapwriter.addTuple("hasDeclareKeyword", lbl);
|
||||
trapwriter.addTuple("has_declare_keyword", lbl);
|
||||
}
|
||||
DeclaredNames hoistedVars =
|
||||
scopeManager.collectDeclaredNames(nd.getBody(), isStrict, false, DeclKind.none);
|
||||
@@ -1539,7 +1539,7 @@ public class ASTExtractor {
|
||||
}
|
||||
|
||||
if (nd.hasDeclareKeyword()) {
|
||||
trapwriter.addTuple("hasDeclareKeyword", methkey);
|
||||
trapwriter.addTuple("has_declare_keyword", methkey);
|
||||
}
|
||||
|
||||
return methkey;
|
||||
@@ -1947,7 +1947,7 @@ public class ASTExtractor {
|
||||
trapwriter.addTuple("isConstEnum", key);
|
||||
}
|
||||
if (nd.hasDeclareKeyword()) {
|
||||
trapwriter.addTuple("hasDeclareKeyword", key);
|
||||
trapwriter.addTuple("has_declare_keyword", key);
|
||||
}
|
||||
emitNodeSymbol(nd, key);
|
||||
return key;
|
||||
@@ -1968,7 +1968,7 @@ public class ASTExtractor {
|
||||
@Override
|
||||
public Label visit(ExternalModuleDeclaration nd, Context c) {
|
||||
Label key = super.visit(nd, c);
|
||||
trapwriter.addTuple("hasDeclareKeyword", key);
|
||||
trapwriter.addTuple("has_declare_keyword", key);
|
||||
visit(nd.getName(), key, -1, IdContext.label);
|
||||
DeclaredNames hoistedVars =
|
||||
scopeManager.collectDeclaredNames(nd.getBody(), isStrict, false, DeclKind.none);
|
||||
@@ -2013,7 +2013,7 @@ public class ASTExtractor {
|
||||
// The fake scope does not exist at the QL level, as it is indistinguishable
|
||||
// from the global scope.
|
||||
Label key = super.visit(nd, c);
|
||||
trapwriter.addTuple("hasDeclareKeyword", key);
|
||||
trapwriter.addTuple("has_declare_keyword", key);
|
||||
DeclaredNames hoistedVars =
|
||||
scopeManager.collectDeclaredNames(nd.getBody(), isStrict, false, DeclKind.none);
|
||||
DeclaredNames lexicalVars =
|
||||
|
||||
@@ -9711,7 +9711,7 @@ stmts(#23113,17,#22805,13,"declare ... number;")
|
||||
locations_default(#23114,#10000,94,3,94,42)
|
||||
hasLocation(#23113,#23114)
|
||||
stmt_containers(#23113,#22805)
|
||||
hasDeclareKeyword(#23113)
|
||||
has_declare_keyword(#23113)
|
||||
#23115=*
|
||||
exprs(#23115,78,#23113,-1,"foo")
|
||||
hasLocation(#23115,#22008)
|
||||
@@ -9751,7 +9751,7 @@ stmts(#23123,17,#22805,14,"declare ... string;")
|
||||
locations_default(#23124,#10000,95,3,95,42)
|
||||
hasLocation(#23123,#23124)
|
||||
stmt_containers(#23123,#22805)
|
||||
hasDeclareKeyword(#23123)
|
||||
has_declare_keyword(#23123)
|
||||
#23125=*
|
||||
exprs(#23125,78,#23123,-1,"foo")
|
||||
hasLocation(#23125,#22030)
|
||||
@@ -9789,7 +9789,7 @@ stmts(#23132,17,#22805,15,"declare ... number;")
|
||||
locations_default(#23133,#10000,96,3,96,60)
|
||||
hasLocation(#23132,#23133)
|
||||
stmt_containers(#23132,#22805)
|
||||
hasDeclareKeyword(#23132)
|
||||
has_declare_keyword(#23132)
|
||||
#23134=*
|
||||
exprs(#23134,78,#23132,-1,"foo")
|
||||
hasLocation(#23134,#22052)
|
||||
|
||||
@@ -54,7 +54,7 @@ hasLocation(#20001,#20016)
|
||||
stmts(#20017,26,#20001,0,"declare class C {}")
|
||||
hasLocation(#20017,#20003)
|
||||
stmt_containers(#20017,#20001)
|
||||
hasDeclareKeyword(#20017)
|
||||
has_declare_keyword(#20017)
|
||||
#20018=*
|
||||
exprs(#20018,78,#20017,0,"C")
|
||||
hasLocation(#20018,#20009)
|
||||
|
||||
@@ -688,7 +688,7 @@ exprContainers(#20248,#20001)
|
||||
literals("b","b",#20248)
|
||||
decl(#20248,#20243)
|
||||
typedecl(#20248,#20244)
|
||||
hasDeclareKeyword(#20238)
|
||||
has_declare_keyword(#20238)
|
||||
#20249=*
|
||||
stmts(#20249,36,#20001,2,"const e ... +2, b }")
|
||||
hasLocation(#20249,#20009)
|
||||
@@ -806,7 +806,7 @@ literals("b","b",#20275)
|
||||
decl(#20275,#20270)
|
||||
typedecl(#20275,#20271)
|
||||
isConstEnum(#20265)
|
||||
hasDeclareKeyword(#20265)
|
||||
has_declare_keyword(#20265)
|
||||
#20276=*
|
||||
stmts(#20276,17,#20001,4,"functio ... rn x; }")
|
||||
hasLocation(#20276,#20015)
|
||||
|
||||
@@ -107,7 +107,7 @@ stmts(#20035,17,#20034,-1,"declare ... foo();")
|
||||
locations_default(#20036,#10000,1,8,1,30)
|
||||
hasLocation(#20035,#20036)
|
||||
stmt_containers(#20035,#20001)
|
||||
hasDeclareKeyword(#20035)
|
||||
has_declare_keyword(#20035)
|
||||
#20037=*
|
||||
exprs(#20037,78,#20035,-1,"foo")
|
||||
hasLocation(#20037,#20013)
|
||||
|
||||
@@ -234,7 +234,7 @@ stmts(#20082,37,#20001,0,"declare ... = M;\n}")
|
||||
locations_default(#20083,#10000,1,1,9,1)
|
||||
hasLocation(#20082,#20083)
|
||||
stmt_containers(#20082,#20001)
|
||||
hasDeclareKeyword(#20082)
|
||||
has_declare_keyword(#20082)
|
||||
#20084=*
|
||||
exprs(#20084,4,#20082,-1,"""X""")
|
||||
hasLocation(#20084,#20025)
|
||||
|
||||
@@ -592,7 +592,7 @@ local_type_names(#20223,"C",#20000)
|
||||
stmts(#20224,18,#20001,0,"declare var A : any;")
|
||||
hasLocation(#20224,#20003)
|
||||
stmt_containers(#20224,#20001)
|
||||
hasDeclareKeyword(#20224)
|
||||
has_declare_keyword(#20224)
|
||||
#20225=*
|
||||
exprs(#20225,64,#20224,0,"A : any")
|
||||
#20226=@"loc,{#10000},1,13,1,19"
|
||||
@@ -619,7 +619,7 @@ literals("any","any",#20229)
|
||||
stmts(#20230,18,#20001,1,"declare var B : any;")
|
||||
hasLocation(#20230,#20005)
|
||||
stmt_containers(#20230,#20001)
|
||||
hasDeclareKeyword(#20230)
|
||||
has_declare_keyword(#20230)
|
||||
#20231=*
|
||||
exprs(#20231,64,#20230,0,"B : any")
|
||||
#20232=@"loc,{#10000},2,13,2,19"
|
||||
@@ -646,7 +646,7 @@ literals("any","any",#20235)
|
||||
stmts(#20236,18,#20001,2,"declare var C : any;")
|
||||
hasLocation(#20236,#20007)
|
||||
stmt_containers(#20236,#20001)
|
||||
hasDeclareKeyword(#20236)
|
||||
has_declare_keyword(#20236)
|
||||
#20237=*
|
||||
exprs(#20237,64,#20236,0,"C : any")
|
||||
#20238=@"loc,{#10000},3,13,3,19"
|
||||
|
||||
@@ -702,7 +702,7 @@ local_type_names(#20254,"C",#20000)
|
||||
stmts(#20255,17,#20001,0,"declare ... on f();")
|
||||
hasLocation(#20255,#20020)
|
||||
stmt_containers(#20255,#20001)
|
||||
hasDeclareKeyword(#20255)
|
||||
has_declare_keyword(#20255)
|
||||
#20256=*
|
||||
exprs(#20256,78,#20255,-1,"f")
|
||||
hasLocation(#20256,#20079)
|
||||
@@ -940,7 +940,7 @@ stmts(#20312,26,#20001,2,"declare ... mber;\n}")
|
||||
locations_default(#20313,#10000,18,1,29,1)
|
||||
hasLocation(#20312,#20313)
|
||||
stmt_containers(#20312,#20001)
|
||||
hasDeclareKeyword(#20312)
|
||||
has_declare_keyword(#20312)
|
||||
isAbstractClass(#20312)
|
||||
#20314=*
|
||||
exprs(#20314,78,#20312,0,"D")
|
||||
|
||||
@@ -532,7 +532,7 @@ stmt_containers(#20186,#20178)
|
||||
stmts(#20188,17,#20001,2,"declare ... umber);")
|
||||
hasLocation(#20188,#20011)
|
||||
stmt_containers(#20188,#20001)
|
||||
hasDeclareKeyword(#20188)
|
||||
has_declare_keyword(#20188)
|
||||
#20189=*
|
||||
exprs(#20189,78,#20188,-1,"ambient")
|
||||
hasLocation(#20189,#20091)
|
||||
|
||||
@@ -148,12 +148,12 @@ class ASTNode extends @ast_node, NodeInStmtContainer {
|
||||
or
|
||||
this instanceof InterfaceDeclaration
|
||||
or
|
||||
hasDeclareKeyword(this)
|
||||
has_declare_keyword(this)
|
||||
or
|
||||
hasTypeKeyword(this)
|
||||
or
|
||||
// An export such as `export declare function f()` should be seen as ambient.
|
||||
hasDeclareKeyword(this.(ExportNamedDeclaration).getOperand())
|
||||
has_declare_keyword(this.(ExportNamedDeclaration).getOperand())
|
||||
or
|
||||
exists(Function f |
|
||||
this = f and
|
||||
|
||||
@@ -106,3 +106,7 @@ deprecated predicate jumpTargets(Stmt jump, Stmt target) { jump_targets(jump, ta
|
||||
* Use `NamespaceDeclaration#isInstantiated() instead.`
|
||||
*/
|
||||
deprecated predicate isInstantiated(NamespaceDeclaration decl) { is_instantiated(decl) }
|
||||
/**
|
||||
* Alias for the predicate `has_declare_keyword` defined in the .dbscheme.
|
||||
*/
|
||||
deprecated predicate hasDeclareKeyword(ASTNode stmt) { has_declare_keyword(stmt) }
|
||||
|
||||
@@ -276,7 +276,7 @@ class ClassDefinition extends @classdefinition, ClassOrInterface, AST::ValueNode
|
||||
*/
|
||||
class ClassDeclStmt extends @classdeclstmt, ClassDefinition, Stmt {
|
||||
override ControlFlowNode getFirstControlFlowNode() {
|
||||
if hasDeclareKeyword(this) then result = this else result = getIdentifier()
|
||||
if has_declare_keyword(this) then result = this else result = getIdentifier()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class NamespaceDeclaration extends NamespaceDefinition, StmtContainer, @namespac
|
||||
predicate isInstantiated() { is_instantiated(this) }
|
||||
|
||||
override ControlFlowNode getFirstControlFlowNode() {
|
||||
if hasDeclareKeyword(this) then result = this else result = getIdentifier()
|
||||
if has_declare_keyword(this) then result = this else result = getIdentifier()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ case @stmt.kind of
|
||||
is_instantiated(unique int decl: @namespacedeclaration ref);
|
||||
|
||||
@declarablenode = @declstmt | @namespacedeclaration | @classdeclstmt | @functiondeclstmt | @enumdeclaration | @externalmoduledeclaration | @globalaugmentationdeclaration | @field;
|
||||
hasDeclareKeyword(unique int stmt: @declarablenode ref);
|
||||
has_declare_keyword(unique int stmt: @declarablenode ref);
|
||||
|
||||
isForAwaitOf(unique int forof: @forofstmt ref);
|
||||
|
||||
|
||||
@@ -7919,7 +7919,7 @@
|
||||
<dependencies/>
|
||||
</relation>
|
||||
<relation>
|
||||
<name>hasDeclareKeyword</name>
|
||||
<name>has_declare_keyword</name>
|
||||
<cardinality>66</cardinality>
|
||||
<columnsizes>
|
||||
<e>
|
||||
|
||||
@@ -16,3 +16,5 @@ jump_targets.rel: reorder jumpTargets.rel(int jump, int target) jump target
|
||||
jumpTargets.rel: delete
|
||||
is_instantiated.rel: reorder isInstantiated.rel(int decl) decl
|
||||
isInstantiated.rel: delete
|
||||
has_declare_keyword.rel: reorder hasDeclareKeyword.rel(int stmt) stmt
|
||||
hasDeclareKeyword.rel: delete
|
||||
|
||||
Reference in New Issue
Block a user