Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22bce64

Browse files
committed
renamed "isAsync" to "is_async"
1 parent ba645b5 commit 22bce64

13 files changed

Lines changed: 23 additions & 16 deletions

File tree

javascript/extractor/src/com/semmle/js/extractor/ASTExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ public Label visit(FunctionDeclaration nd, Context c) {
891891
private void extractFunctionAttributes(IFunction nd, Label key) {
892892
if (nd.isGenerator()) trapwriter.addTuple("is_generator", key);
893893
if (nd.hasRest()) trapwriter.addTuple("has_rest_parameter", key);
894-
if (nd.isAsync()) trapwriter.addTuple("isAsync", key);
894+
if (nd.isAsync()) trapwriter.addTuple("is_async", key);
895895
}
896896

897897
@Override

javascript/extractor/tests/es2017/output/trap/async-await.js.trap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ decl(#20078,#20077)
232232
#20079=@"var;{arguments};{#20076}"
233233
variables(#20079,"arguments",#20076)
234234
is_arguments_object(#20079)
235-
isAsync(#20073)
235+
is_async(#20073)
236236
#20080=*
237237
stmts(#20080,1,#20073,-2,"{\n try ... ;\n }\n}")
238238
#20081=@"loc,{#10000},1,30,7,1"

javascript/extractor/tests/es2017/output/trap/export-async-1.js.trap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ scopenesting(#20034,#20027)
108108
#20035=@"var;{arguments};{#20034}"
109109
variables(#20035,"arguments",#20034)
110110
is_arguments_object(#20035)
111-
isAsync(#20031)
111+
is_async(#20031)
112112
#20036=*
113113
stmts(#20036,1,#20031,-2,"{}")
114114
#20037=@"loc,{#10000},1,35,1,36"

javascript/extractor/tests/es2017/output/trap/export-async-2.js.trap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ scopenesting(#20030,#20025)
9696
#20031=@"var;{arguments};{#20030}"
9797
variables(#20031,"arguments",#20030)
9898
is_arguments_object(#20031)
99-
isAsync(#20028)
99+
is_async(#20028)
100100
#20032=*
101101
stmts(#20032,1,#20028,-2,"{}")
102102
#20033=@"loc,{#10000},1,34,1,35"

javascript/extractor/tests/es2017/output/trap/invalid-async-fn.js.trap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ hasLocation(#20034,#20015)
109109
expr_containers(#20034,#20030)
110110
literals("x","x",#20034)
111111
decl(#20034,#20033)
112-
isAsync(#20030)
112+
is_async(#20030)
113113
#20035=*
114114
exprs(#20035,79,#20030,-2,"x")
115115
hasLocation(#20035,#20023)

javascript/extractor/tests/es2018/output/trap/asyncIter.js.trap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ scopenesting(#20139,#20000)
381381
variables(#20140,"arguments",#20139)
382382
is_arguments_object(#20140)
383383
is_generator(#20137)
384-
isAsync(#20137)
384+
is_async(#20137)
385385
#20141=*
386386
stmts(#20141,1,#20137,-2,"{}")
387387
#20142=@"loc,{#10000},1,27,1,28"
@@ -432,7 +432,7 @@ scopenesting(#20152,#20146)
432432
variables(#20153,"arguments",#20152)
433433
is_arguments_object(#20153)
434434
is_generator(#20150)
435-
isAsync(#20150)
435+
is_async(#20150)
436436
#20154=*
437437
stmts(#20154,1,#20150,-2,"{}")
438438
#20155=@"loc,{#10000},4,22,4,23"
@@ -482,7 +482,7 @@ scopenesting(#20165,#20146)
482482
variables(#20166,"arguments",#20165)
483483
is_arguments_object(#20166)
484484
is_generator(#20163)
485-
isAsync(#20163)
485+
is_async(#20163)
486486
#20167=*
487487
stmts(#20167,1,#20163,-2,"{}")
488488
#20168=@"loc,{#10000},5,35,5,36"
@@ -572,7 +572,7 @@ scopenesting(#20188,#20000)
572572
variables(#20189,"arguments",#20188)
573573
is_arguments_object(#20189)
574574
is_generator(#20186)
575-
isAsync(#20186)
575+
is_async(#20186)
576576
#20190=*
577577
stmts(#20190,1,#20186,-2,"{}")
578578
#20191=@"loc,{#10000},9,22,9,23"
@@ -620,7 +620,7 @@ scopenesting(#20200,#20000)
620620
variables(#20201,"arguments",#20200)
621621
is_arguments_object(#20201)
622622
is_generator(#20198)
623-
isAsync(#20198)
623+
is_async(#20198)
624624
#20202=*
625625
stmts(#20202,1,#20198,-2,"{}")
626626
#20203=@"loc,{#10000},10,35,10,36"

javascript/extractor/tests/esnext/output/trap/async-generators.js.trap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ scopenesting(#20072,#20000)
206206
variables(#20073,"arguments",#20072)
207207
is_arguments_object(#20073)
208208
is_generator(#20069)
209-
isAsync(#20069)
209+
is_async(#20069)
210210
#20074=*
211211
stmts(#20074,1,#20069,-2,"{\n}")
212212
#20075=@"loc,{#10000},1,23,2,1"
@@ -234,7 +234,7 @@ variables(#20080,"x",#20079)
234234
#20081=@"var;{arguments};{#20079}"
235235
variables(#20081,"arguments",#20079)
236236
is_arguments_object(#20081)
237-
isAsync(#20076)
237+
is_async(#20076)
238238
#20082=*
239239
stmts(#20082,1,#20076,-2,"{\n for ... o());\n}")
240240
#20083=@"loc,{#10000},4,22,6,1"

javascript/extractor/tests/flow/output/trap/async.js.trap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ expr_containers(#20046,#20001)
141141
scopes(#20048,1)
142142
scopenodes(#20046,#20048)
143143
scopenesting(#20048,#20000)
144-
isAsync(#20046)
144+
is_async(#20046)
145145
#20049=*
146146
exprs(#20049,92,#20046,-2,"await foo()")
147147
#20050=@"loc,{#10000},1,38,1,48"

javascript/ql/src/semmle/javascript/Aliases.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,3 +290,8 @@ deprecated predicate isGenerator(Function fun) { is_generator(fun) }
290290
* Use `Function#hasRestParameter()` instead.
291291
*/
292292
deprecated predicate hasRestParameter(Function fun) { has_rest_parameter(fun) }
293+
/**
294+
* Alias for the predicate `is_async` defined in the .dbscheme.
295+
* Use `Function#isAsync()` instead.
296+
*/
297+
deprecated predicate isAsync(Function fun) { is_async(fun) }

javascript/ql/src/semmle/javascript/Functions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class Function extends @function, Parameterized, TypeParameterized, StmtContaine
202202
predicate hasTrailingComma() { lastTokenOfParameterList().getNextToken().getValue() = "," }
203203

204204
/** Holds if this function is an asynchronous function. */
205-
predicate isAsync() { isAsync(this) }
205+
predicate isAsync() { is_async(this) }
206206

207207
/** Holds if this function is asynchronous or a generator. */
208208
predicate isAsyncOrGenerator() { isAsync() or isGenerator() }

0 commit comments

Comments
 (0)