From c0917434ebc01814f443836ea74da8da506feb55 Mon Sep 17 00:00:00 2001 From: Napalys Klicius Date: Wed, 30 Apr 2025 11:45:00 +0200 Subject: [PATCH] Removed code duplication --- .../lib/semmle/javascript/dataflow/Nodes.qll | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll b/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll index 22e8511509a..52547d5f590 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll @@ -1309,8 +1309,7 @@ module ClassNode { result = method.getBody().flow() ) or - // ES6 class property in constructor - astNode instanceof ClassDefinition and + // ES6 class property or Function-style class methods via constructor kind = MemberKind::method() and exists(ThisNode receiver | receiver = this.getConstructor().getReceiver() and @@ -1324,14 +1323,6 @@ module ClassNode { proto.hasPropertyWrite(name, result) ) or - // Function-style class methods via constructor - astNode instanceof Function and - kind = MemberKind::method() and - exists(ThisNode receiver | - receiver = this.getConstructor().getReceiver() and - receiver.hasPropertyWrite(name, result) - ) - or // Function-style class accessors astNode instanceof Function and exists(PropertyAccessor accessor | @@ -1351,8 +1342,7 @@ module ClassNode { result = method.getBody().flow() ) or - // ES6 class property in constructor - astNode instanceof ClassDefinition and + // ES6 class property or Function-style class methods via constructor kind = MemberKind::method() and exists(ThisNode receiver | receiver = this.getConstructor().getReceiver() and @@ -1366,14 +1356,6 @@ module ClassNode { result = proto.getAPropertySource() ) or - // Function-style class methods via constructor - astNode instanceof Function and - kind = MemberKind::method() and - exists(ThisNode receiver | - receiver = this.getConstructor().getReceiver() and - result = receiver.getAPropertySource() - ) - or // Function-style class accessors astNode instanceof Function and exists(PropertyAccessor accessor |