mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Apply suggestions from code review
Co-authored-by: Taus <tausbn@github.com>
This commit is contained in:
@@ -40,8 +40,12 @@ class Function extends Function_, Scope, AstNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this is a lambda.
|
||||
* We detect this by comparing its name to the one the extractor gives to lambdas.
|
||||
* Holds if this function represents a lambda.
|
||||
*
|
||||
* The extractor reifies each lambda expression as a (local) function with the name
|
||||
* "lambda". As `lambda` is a keyword in Python, it's impossible to create a function with this
|
||||
* name otherwise, and so it's impossible to get a non-lambda function accidentally
|
||||
* classified as a lambda.
|
||||
*/
|
||||
predicate isLambda() { this.getName() = "lambda" }
|
||||
|
||||
|
||||
@@ -721,7 +721,7 @@ abstract class FunctionValue extends CallableValue {
|
||||
/** Gets a class that this function may return */
|
||||
abstract ClassValue getAnInferredReturnType();
|
||||
|
||||
/** Wheter this is a lambda function */
|
||||
/** Holds if this function represents a lambda. */
|
||||
predicate isLambda() { this.getOrigin().getNode() instanceof Lambda }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user