Removed code duplication

This commit is contained in:
Napalys Klicius
2025-04-30 11:45:00 +02:00
parent fc7520e9e7
commit c0917434eb

View File

@@ -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 |