mirror of
https://github.com/github/codeql.git
synced 2026-04-18 13:34:02 +02:00
JavaScript: Autoformat.
This commit is contained in:
@@ -36,16 +36,16 @@ predicate isDeclaration(Expr e) {
|
||||
*/
|
||||
predicate isGetterProperty(string name) {
|
||||
// there is a call of the form `Object.defineProperty(..., name, descriptor)` ...
|
||||
exists(CallToObjectDefineProperty defProp |
|
||||
name = defProp.getPropertyName() |
|
||||
exists(CallToObjectDefineProperty defProp | name = defProp.getPropertyName() |
|
||||
// ... where `descriptor` defines a getter
|
||||
defProp.hasPropertyAttributeWrite("get", _) or
|
||||
defProp.hasPropertyAttributeWrite("get", _)
|
||||
or
|
||||
// ... where `descriptor` may define a getter
|
||||
exists (DataFlow::SourceNode descriptor |
|
||||
descriptor.flowsTo(defProp.getPropertyDescriptor()) |
|
||||
descriptor.isIncomplete(_) or
|
||||
exists(DataFlow::SourceNode descriptor | descriptor.flowsTo(defProp.getPropertyDescriptor()) |
|
||||
descriptor.isIncomplete(_)
|
||||
or
|
||||
// minimal escape analysis for the descriptor
|
||||
exists (DataFlow::InvokeNode invk |
|
||||
exists(DataFlow::InvokeNode invk |
|
||||
not invk = defProp and
|
||||
descriptor.flowsTo(invk.getAnArgument())
|
||||
)
|
||||
|
||||
@@ -28,9 +28,10 @@ private predicate isBoundInMethod(MethodDeclaration method) {
|
||||
)
|
||||
or
|
||||
// require("auto-bind")(this)
|
||||
exists (string mod |
|
||||
exists(string mod |
|
||||
mod = "auto-bind" or
|
||||
mod = "react-autobind" |
|
||||
mod = "react-autobind"
|
||||
|
|
||||
thiz.flowsTo(DataFlow::moduleImport(mod).getACall().getArgument(0))
|
||||
)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user