Skip to content

Commit c091743

Browse files
committed
Removed code duplication
1 parent fc7520e commit c091743

File tree

1 file changed

+2
-20
lines changed
  • javascript/ql/lib/semmle/javascript/dataflow

1 file changed

+2
-20
lines changed

javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,7 @@ module ClassNode {
13091309
result = method.getBody().flow()
13101310
)
13111311
or
1312-
// ES6 class property in constructor
1313-
astNode instanceof ClassDefinition and
1312+
// ES6 class property or Function-style class methods via constructor
13141313
kind = MemberKind::method() and
13151314
exists(ThisNode receiver |
13161315
receiver = this.getConstructor().getReceiver() and
@@ -1324,14 +1323,6 @@ module ClassNode {
13241323
proto.hasPropertyWrite(name, result)
13251324
)
13261325
or
1327-
// Function-style class methods via constructor
1328-
astNode instanceof Function and
1329-
kind = MemberKind::method() and
1330-
exists(ThisNode receiver |
1331-
receiver = this.getConstructor().getReceiver() and
1332-
receiver.hasPropertyWrite(name, result)
1333-
)
1334-
or
13351326
// Function-style class accessors
13361327
astNode instanceof Function and
13371328
exists(PropertyAccessor accessor |
@@ -1351,8 +1342,7 @@ module ClassNode {
13511342
result = method.getBody().flow()
13521343
)
13531344
or
1354-
// ES6 class property in constructor
1355-
astNode instanceof ClassDefinition and
1345+
// ES6 class property or Function-style class methods via constructor
13561346
kind = MemberKind::method() and
13571347
exists(ThisNode receiver |
13581348
receiver = this.getConstructor().getReceiver() and
@@ -1366,14 +1356,6 @@ module ClassNode {
13661356
result = proto.getAPropertySource()
13671357
)
13681358
or
1369-
// Function-style class methods via constructor
1370-
astNode instanceof Function and
1371-
kind = MemberKind::method() and
1372-
exists(ThisNode receiver |
1373-
receiver = this.getConstructor().getReceiver() and
1374-
result = receiver.getAPropertySource()
1375-
)
1376-
or
13771359
// Function-style class accessors
13781360
astNode instanceof Function and
13791361
exists(PropertyAccessor accessor |

0 commit comments

Comments
 (0)