Update Nodes.qll

Applied suggestions

Co-Authored-By: Asger F <316427+asgerf@users.noreply.github.com>
This commit is contained in:
Napalys Klicius
2025-04-24 12:06:32 +02:00
parent 6a284eeecb
commit c57172121e
2 changed files with 4 additions and 2 deletions

View File

@@ -1242,11 +1242,12 @@ module ClassNode {
*/
class FunctionStyleClass extends Range, DataFlow::ValueNode {
override AST::ValueNode astNode;
AbstractFunction function;
AbstractCallable function;
FunctionStyleClass() {
// ES6 class case
astNode instanceof ClassDefinition
astNode instanceof ClassDefinition and
function.(AbstractClass).getClass() = astNode
or
// Function-style class case
astNode instanceof Function and

View File

@@ -194,6 +194,7 @@ test_ConstructorDefinitions
| tst.js:11:9:11:8 | constructor() {} |
test_ClassNodeConstructor
| dataflow.js:4:2:13:2 | class F ... \\n\\t\\t}\\n\\t} | dataflow.js:4:12:4:11 | () {} |
| dataflow.js:4:12:4:11 | () {} | dataflow.js:4:12:4:11 | () {} |
| fields.js:1:1:4:1 | class C ... = 42\\n} | fields.js:1:9:1:8 | () {} |
| points.js:1:1:18:1 | class P ... ;\\n }\\n} | points.js:2:14:5:3 | (x, y) ... y;\\n } |
| points.js:20:1:33:1 | class C ... ;\\n }\\n} | points.js:21:14:24:3 | (x, y, ... c;\\n } |