Skip to content

Commit 3b7a6e7

Browse files
committed
Removed code duplication
1 parent 39ecf83 commit 3b7a6e7

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

+2-20
Original file line numberDiff line numberDiff line change
@@ -1432,8 +1432,7 @@ module ClassNode {
14321432
result = method.getBody().flow()
14331433
)
14341434
or
1435-
// ES6 class property in constructor
1436-
astNode instanceof ClassDefinition and
1435+
// ES6 class property or Function-style class methods via constructor
14371436
kind = MemberKind::method() and
14381437
exists(ThisNode receiver |
14391438
receiver = this.getConstructor().getReceiver() and
@@ -1447,14 +1446,6 @@ module ClassNode {
14471446
proto.hasPropertyWrite(name, result)
14481447
)
14491448
or
1450-
// Function-style class methods via constructor
1451-
astNode instanceof Function and
1452-
kind = MemberKind::method() and
1453-
exists(ThisNode receiver |
1454-
receiver = this.getConstructor().getReceiver() and
1455-
receiver.hasPropertyWrite(name, result)
1456-
)
1457-
or
14581449
// Function-style class accessors
14591450
astNode instanceof Function and
14601451
exists(PropertyAccessor accessor |
@@ -1474,8 +1465,7 @@ module ClassNode {
14741465
result = method.getBody().flow()
14751466
)
14761467
or
1477-
// ES6 class property in constructor
1478-
astNode instanceof ClassDefinition and
1468+
// ES6 class property or Function-style class methods via constructor
14791469
kind = MemberKind::method() and
14801470
exists(ThisNode receiver |
14811471
receiver = this.getConstructor().getReceiver() and
@@ -1489,14 +1479,6 @@ module ClassNode {
14891479
result = proto.getAPropertySource()
14901480
)
14911481
or
1492-
// Function-style class methods via constructor
1493-
astNode instanceof Function and
1494-
kind = MemberKind::method() and
1495-
exists(ThisNode receiver |
1496-
receiver = this.getConstructor().getReceiver() and
1497-
result = receiver.getAPropertySource()
1498-
)
1499-
or
15001482
// Function-style class accessors
15011483
astNode instanceof Function and
15021484
exists(PropertyAccessor accessor |

0 commit comments

Comments
 (0)