Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 3e6ad8a

Browse files
authored
Merge pull request #391 from github/field-scopes
Field declarations for private properties receive scopes
2 parents c02b237 + 82679f8 commit 3e6ad8a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,11 +1661,14 @@ inherit .containing_class_value
16611661

16621662

16631663

1664-
(field_definition
1665-
property:(property_identifier)@property)@field_def {
1666-
1664+
(field_definition)@field_def {
16671665
node @field_def.after_scope
16681666
node @field_def.before_scope
1667+
}
1668+
1669+
(field_definition
1670+
property:(_)@property)@field_def {
1671+
16691672
node @property.pop
16701673
node property_pop_dot
16711674

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ function foo() { }
1111
function foo(a) { }
1212
function foo(undefined) { }
1313
function* foo() { }
14-
class Foo { }
14+
class Foo {
15+
#x = null;
16+
}
1517
@Foo class Bar { }
1618
@Foo.Quux class Bar { }
1719
@Foo() class Bar { }

0 commit comments

Comments
 (0)