Skip to content

Commit cb0f675

Browse files
authored
Merge pull request #400 from github/classless-values
Object literals containing methods named constructor
2 parents b61bb84 + 61648e1 commit cb0f675

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

languages/tree-sitter-stack-graphs-javascript/src/stack-graphs.tsg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,6 +2525,9 @@ inherit .containing_class_value
25252525
attr (@object.member_pop) pop_symbol = "GUARD:MEMBER"
25262526
edge @object.value -> @object.member_pop
25272527

2528+
node @object.class_value
2529+
node @object.constructor
2530+
25282531
}
25292532

25302533
; empty objects

languages/tree-sitter-stack-graphs-javascript/test/base_syntax.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import "foo";
1111
debugger;
1212
var x;
1313
let x;
14+
let x = {
15+
get constructor() {}
16+
};
1417
function foo() { }
1518
function foo(a) { }
1619
function foo(undefined) { }

0 commit comments

Comments
 (0)