renamed "isGenerator" to "is_generator"

This commit is contained in:
Erik Krogh Kristensen
2020-09-04 11:52:14 +02:00
parent a57f93b41e
commit b3f7c26669
14 changed files with 23 additions and 16 deletions

View File

@@ -889,7 +889,7 @@ public class ASTExtractor {
}
private void extractFunctionAttributes(IFunction nd, Label key) {
if (nd.isGenerator()) trapwriter.addTuple("isGenerator", key);
if (nd.isGenerator()) trapwriter.addTuple("is_generator", key);
if (nd.hasRest()) trapwriter.addTuple("hasRestParameter", key);
if (nd.isAsync()) trapwriter.addTuple("isAsync", key);
}

View File

@@ -119,7 +119,7 @@ scopenesting(#20039,#20000)
#20040=@"var;{arguments};{#20039}"
variables(#20040,"arguments",#20039)
is_arguments_object(#20040)
isGenerator(#20037)
is_generator(#20037)
#20041=*
stmts(#20041,1,#20037,-2,"{\n yield* g();\n}")
#20042=@"loc,{#10000},1,15,3,1"

View File

@@ -186,7 +186,7 @@ variables(#20064,"index",#20063)
#20065=@"var;{arguments};{#20063}"
variables(#20065,"arguments",#20063)
is_arguments_object(#20065)
isGenerator(#20061)
is_generator(#20061)
#20066=*
stmts(#20066,1,#20061,-2,"{\n var ... ex++;\n}")
#20067=@"loc,{#10000},1,16,5,1"

View File

@@ -102,7 +102,7 @@ scopenesting(#20032,#20000)
#20033=@"var;{arguments};{#20032}"
variables(#20033,"arguments",#20032)
is_arguments_object(#20033)
isGenerator(#20029)
is_generator(#20029)
#20034=*
stmts(#20034,1,#20029,-2,"{\n yield;\n}")
#20035=@"loc,{#10000},1,15,3,1"

View File

@@ -380,7 +380,7 @@ scopenesting(#20139,#20000)
#20140=@"var;{arguments};{#20139}"
variables(#20140,"arguments",#20139)
is_arguments_object(#20140)
isGenerator(#20137)
is_generator(#20137)
isAsync(#20137)
#20141=*
stmts(#20141,1,#20137,-2,"{}")
@@ -431,7 +431,7 @@ scopenesting(#20152,#20146)
#20153=@"var;{arguments};{#20152}"
variables(#20153,"arguments",#20152)
is_arguments_object(#20153)
isGenerator(#20150)
is_generator(#20150)
isAsync(#20150)
#20154=*
stmts(#20154,1,#20150,-2,"{}")
@@ -481,7 +481,7 @@ scopenesting(#20165,#20146)
#20166=@"var;{arguments};{#20165}"
variables(#20166,"arguments",#20165)
is_arguments_object(#20166)
isGenerator(#20163)
is_generator(#20163)
isAsync(#20163)
#20167=*
stmts(#20167,1,#20163,-2,"{}")
@@ -571,7 +571,7 @@ scopenesting(#20188,#20000)
#20189=@"var;{arguments};{#20188}"
variables(#20189,"arguments",#20188)
is_arguments_object(#20189)
isGenerator(#20186)
is_generator(#20186)
isAsync(#20186)
#20190=*
stmts(#20190,1,#20186,-2,"{}")
@@ -619,7 +619,7 @@ scopenesting(#20200,#20000)
#20201=@"var;{arguments};{#20200}"
variables(#20201,"arguments",#20200)
is_arguments_object(#20201)
isGenerator(#20198)
is_generator(#20198)
isAsync(#20198)
#20202=*
stmts(#20202,1,#20198,-2,"{}")

View File

@@ -205,7 +205,7 @@ scopenesting(#20072,#20000)
#20073=@"var;{arguments};{#20072}"
variables(#20073,"arguments",#20072)
is_arguments_object(#20073)
isGenerator(#20069)
is_generator(#20069)
isAsync(#20069)
#20074=*
stmts(#20074,1,#20069,-2,"{\n}")

View File

@@ -117,7 +117,7 @@ scopenesting(#20038,#20000)
#20039=@"var;{arguments};{#20038}"
variables(#20039,"arguments",#20038)
is_arguments_object(#20039)
isGenerator(#20035)
is_generator(#20035)
#20040=*
stmts(#20040,1,#20035,-2,"{\n yie ... foo"")\n}")
#20041=@"loc,{#10000},1,15,3,1"

View File

@@ -519,7 +519,7 @@ scopenesting(#20186,#20000)
#20187=@"var;{arguments};{#20186}"
variables(#20187,"arguments",#20186)
is_arguments_object(#20187)
isGenerator(#20184)
is_generator(#20184)
#20188=*
stmts(#20188,1,#20184,-2,"{\n yie ... >(x);\n}")
#20189=@"loc,{#10000},3,32,5,1"

View File

@@ -15,6 +15,6 @@ import javascript
from YieldExpr yield, Function f
where
f = yield.getEnclosingFunction() and
not isGenerator(f)
not is_generator(f)
select yield, "This yield expression is contained in $@ which is not marked as a generator.",
f.getFirstToken(), f.describe()

View File

@@ -280,3 +280,8 @@ deprecated predicate unicodePropertyEscapeName(RegExpUnicodePropertyEscape id, s
* Use `RegExpUnicodePropertyEscape#getValue()` instead.
*/
deprecated predicate unicodePropertyEscapeValue(RegExpUnicodePropertyEscape id, string value) { unicode_property_escapevalue(id, value) }
/**
* Alias for the predicate `is_generator` defined in the .dbscheme.
* Use `Function#isGenerator()` instead.
*/
deprecated predicate isGenerator(Function fun) { is_generator(fun) }

View File

@@ -164,7 +164,7 @@ class Function extends @function, Parameterized, TypeParameterized, StmtContaine
/** Holds if this function is a generator function. */
predicate isGenerator() {
isGenerator(this)
is_generator(this)
or
// we also support `yield` in non-generator functions
exists(YieldExpr yield | this = yield.getEnclosingFunction())

View File

@@ -439,7 +439,7 @@ scopenesting (unique int inner: @scope ref,
@parameterized = @function | @catchclause;
@type_parameterized = @function | @classorinterface | @typealiasdeclaration | @mappedtypeexpr | @infertypeexpr;
isGenerator (int fun: @function ref);
is_generator (int fun: @function ref);
hasRestParameter (int fun: @function ref);
isAsync (int fun: @function ref);

View File

@@ -11687,7 +11687,7 @@
</dependencies>
</relation>
<relation>
<name>isGenerator</name>
<name>is_generator</name>
<cardinality>62</cardinality>
<columnsizes>
<e>

View File

@@ -86,3 +86,5 @@ unicode_property_escapename.rel: reorder unicodePropertyEscapeName.rel(int id, s
unicodePropertyEscapeName.rel: delete
unicode_property_escapevalue.rel: reorder unicodePropertyEscapeValue.rel(int id, string value) id value
unicodePropertyEscapeValue.rel: delete
is_generator.rel: reorder isGenerator.rel(int fun) fun
isGenerator.rel: delete