Skip to content

Commit 3cff600

Browse files
committed
fix(47004): ignore arguments name in PropertyAssignment
1 parent 305842b commit 3cff600

File tree

5 files changed

+371
-0
lines changed

5 files changed

+371
-0
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12706,6 +12706,9 @@ namespace ts {
1270612706
case SyntaxKind.ElementAccessExpression:
1270712707
return traverse((node as PropertyAccessExpression | ElementAccessExpression).expression);
1270812708

12709+
case SyntaxKind.PropertyAssignment:
12710+
return traverse((node as PropertyAssignment).initializer);
12711+
1270912712
default:
1271012713
return !nodeStartsNewLexicalEnvironment(node) && !isPartOfTypeNode(node) && !!forEachChild(node, traverse);
1271112714
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
[
2+
{
3+
"marker": {
4+
"fileName": "/tests/cases/fourslash/a.js",
5+
"position": 50,
6+
"name": "1"
7+
},
8+
"quickInfo": {
9+
"kind": "function",
10+
"kindModifiers": "",
11+
"textSpan": {
12+
"start": 50,
13+
"length": 2
14+
},
15+
"displayParts": [
16+
{
17+
"text": "function",
18+
"kind": "keyword"
19+
},
20+
{
21+
"text": " ",
22+
"kind": "space"
23+
},
24+
{
25+
"text": "f2",
26+
"kind": "functionName"
27+
},
28+
{
29+
"text": "(",
30+
"kind": "punctuation"
31+
},
32+
{
33+
"text": "x",
34+
"kind": "parameterName"
35+
},
36+
{
37+
"text": ":",
38+
"kind": "punctuation"
39+
},
40+
{
41+
"text": " ",
42+
"kind": "space"
43+
},
44+
{
45+
"text": "any",
46+
"kind": "keyword"
47+
},
48+
{
49+
"text": ")",
50+
"kind": "punctuation"
51+
},
52+
{
53+
"text": ":",
54+
"kind": "punctuation"
55+
},
56+
{
57+
"text": " ",
58+
"kind": "space"
59+
},
60+
{
61+
"text": "void",
62+
"kind": "keyword"
63+
}
64+
],
65+
"documentation": []
66+
}
67+
},
68+
{
69+
"marker": {
70+
"fileName": "/tests/cases/fourslash/a.js",
71+
"position": 94,
72+
"name": "2"
73+
},
74+
"quickInfo": {
75+
"kind": "function",
76+
"kindModifiers": "",
77+
"textSpan": {
78+
"start": 94,
79+
"length": 2
80+
},
81+
"displayParts": [
82+
{
83+
"text": "function",
84+
"kind": "keyword"
85+
},
86+
{
87+
"text": " ",
88+
"kind": "space"
89+
},
90+
{
91+
"text": "f2",
92+
"kind": "functionName"
93+
},
94+
{
95+
"text": "(",
96+
"kind": "punctuation"
97+
},
98+
{
99+
"text": "x",
100+
"kind": "parameterName"
101+
},
102+
{
103+
"text": ":",
104+
"kind": "punctuation"
105+
},
106+
{
107+
"text": " ",
108+
"kind": "space"
109+
},
110+
{
111+
"text": "any",
112+
"kind": "keyword"
113+
},
114+
{
115+
"text": ")",
116+
"kind": "punctuation"
117+
},
118+
{
119+
"text": ":",
120+
"kind": "punctuation"
121+
},
122+
{
123+
"text": " ",
124+
"kind": "space"
125+
},
126+
{
127+
"text": "void",
128+
"kind": "keyword"
129+
}
130+
],
131+
"documentation": []
132+
}
133+
}
134+
]
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
[
2+
{
3+
"marker": {
4+
"fileName": "/tests/cases/fourslash/a.js",
5+
"position": 9,
6+
"name": "1"
7+
},
8+
"quickInfo": {
9+
"kind": "function",
10+
"kindModifiers": "",
11+
"textSpan": {
12+
"start": 9,
13+
"length": 1
14+
},
15+
"displayParts": [
16+
{
17+
"text": "function",
18+
"kind": "keyword"
19+
},
20+
{
21+
"text": " ",
22+
"kind": "space"
23+
},
24+
{
25+
"text": "f",
26+
"kind": "functionName"
27+
},
28+
{
29+
"text": "(",
30+
"kind": "punctuation"
31+
},
32+
{
33+
"text": "x",
34+
"kind": "parameterName"
35+
},
36+
{
37+
"text": ":",
38+
"kind": "punctuation"
39+
},
40+
{
41+
"text": " ",
42+
"kind": "space"
43+
},
44+
{
45+
"text": "any",
46+
"kind": "keyword"
47+
},
48+
{
49+
"text": ",",
50+
"kind": "punctuation"
51+
},
52+
{
53+
"text": " ",
54+
"kind": "space"
55+
},
56+
{
57+
"text": "...",
58+
"kind": "punctuation"
59+
},
60+
{
61+
"text": "args",
62+
"kind": "parameterName"
63+
},
64+
{
65+
"text": ":",
66+
"kind": "punctuation"
67+
},
68+
{
69+
"text": " ",
70+
"kind": "space"
71+
},
72+
{
73+
"text": "any",
74+
"kind": "keyword"
75+
},
76+
{
77+
"text": "[",
78+
"kind": "punctuation"
79+
},
80+
{
81+
"text": "]",
82+
"kind": "punctuation"
83+
},
84+
{
85+
"text": ")",
86+
"kind": "punctuation"
87+
},
88+
{
89+
"text": ":",
90+
"kind": "punctuation"
91+
},
92+
{
93+
"text": " ",
94+
"kind": "space"
95+
},
96+
{
97+
"text": "void",
98+
"kind": "keyword"
99+
}
100+
],
101+
"documentation": []
102+
}
103+
},
104+
{
105+
"marker": {
106+
"fileName": "/tests/cases/fourslash/a.js",
107+
"position": 33,
108+
"name": "2"
109+
},
110+
"quickInfo": {
111+
"kind": "function",
112+
"kindModifiers": "",
113+
"textSpan": {
114+
"start": 33,
115+
"length": 1
116+
},
117+
"displayParts": [
118+
{
119+
"text": "function",
120+
"kind": "keyword"
121+
},
122+
{
123+
"text": " ",
124+
"kind": "space"
125+
},
126+
{
127+
"text": "f",
128+
"kind": "functionName"
129+
},
130+
{
131+
"text": "(",
132+
"kind": "punctuation"
133+
},
134+
{
135+
"text": "x",
136+
"kind": "parameterName"
137+
},
138+
{
139+
"text": ":",
140+
"kind": "punctuation"
141+
},
142+
{
143+
"text": " ",
144+
"kind": "space"
145+
},
146+
{
147+
"text": "any",
148+
"kind": "keyword"
149+
},
150+
{
151+
"text": ",",
152+
"kind": "punctuation"
153+
},
154+
{
155+
"text": " ",
156+
"kind": "space"
157+
},
158+
{
159+
"text": "...",
160+
"kind": "punctuation"
161+
},
162+
{
163+
"text": "args",
164+
"kind": "parameterName"
165+
},
166+
{
167+
"text": ":",
168+
"kind": "punctuation"
169+
},
170+
{
171+
"text": " ",
172+
"kind": "space"
173+
},
174+
{
175+
"text": "any",
176+
"kind": "keyword"
177+
},
178+
{
179+
"text": "[",
180+
"kind": "punctuation"
181+
},
182+
{
183+
"text": "]",
184+
"kind": "punctuation"
185+
},
186+
{
187+
"text": ")",
188+
"kind": "punctuation"
189+
},
190+
{
191+
"text": ":",
192+
"kind": "punctuation"
193+
},
194+
{
195+
"text": " ",
196+
"kind": "space"
197+
},
198+
{
199+
"text": "void",
200+
"kind": "keyword"
201+
}
202+
],
203+
"documentation": []
204+
}
205+
}
206+
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @allowJs: true
4+
// @filename: a.js
5+
6+
////const foo = {
7+
//// f1: (params) => { }
8+
////}
9+
////
10+
////function /*1*/f2(x) {
11+
//// foo.f1({ x, arguments: [] });
12+
////}
13+
////
14+
/////*2*/f2('');
15+
16+
verify.baselineQuickInfo();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @allowJs: true
4+
// @filename: a.js
5+
6+
////function /*1*/f(x) {
7+
//// arguments;
8+
////}
9+
////
10+
/////*2*/f('');
11+
12+
verify.baselineQuickInfo();

0 commit comments

Comments
 (0)