Skip to content

Commit 080d15a

Browse files
committed
Web Inspector: 'arguments' should be accessible from the console
https://bugs.webkit.org/show_bug.cgi?id=121208 <rdar://problem/14972198> Reviewed by Keith Miller. * Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): Force `arguments` to be created even if it's not used when the debugger is enabled. * LayoutTests/inspector/debugger/breakpoint-scope-expected.txt: * LayoutTests/inspector/debugger/paused-scopes-expected.txt: * LayoutTests/inspector/debugger/tail-deleted-frames/tail-deleted-frames-scopes-expected.txt: * LayoutTests/inspector/debugger/tail-deleted-frames/tail-deleted-frames-vm-entry-expected.txt: * LayoutTests/inspector/model/scope-chain-node-expected.txt: Canonical link: https://commits.webkit.org/316515@main
1 parent a473425 commit 080d15a

6 files changed

Lines changed: 87 additions & 11 deletions

File tree

‎LayoutTests/inspector/debugger/breakpoint-scope-expected.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ Testing that we can access scope in various functions.
44
Starting Test
55
Hit breakpoint at line: 4, column: 8
66
scope-chain-type-closure properties:
7+
arguments
78
reject
89
resolve
910
scope-chain-type-closure properties:
1011
p
12+
arguments
1113
scope-chain-type-global-lexical-environment properties:
1214
lexicalVariable
1315
scope-chain-type-global (properties not listed)

‎LayoutTests/inspector/debugger/paused-scopes-expected.txt‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ CALLFRAME: firstPause
1111
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
1212
- barLexicalVariable2
1313
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
14+
- arguments
1415
- barVarVariable1
1516
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
1617
- firstPause
1718
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
1819
- fakeFirstPauseLexicalVariable
1920
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
21+
- arguments
2022
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
2123
- fooLexicalVariable2
2224
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
25+
- arguments
2326
- fooVarVariable1
2427
- firstPause
2528
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -30,13 +33,16 @@ CALLFRAME: firstPause
3033
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
3134
- barLexicalVariable2
3235
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:21:29)
36+
- arguments
3337
- barVarVariable1
3438
- barLexicalVariable2
3539
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
3640
- firstPause
3741
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
42+
- arguments
3843
- fakeFirstPauseLexicalVariable
3944
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
45+
- arguments
4046
- fooVarVariable1
4147
- firstPause
4248
- fooLexicalVariable2
@@ -50,9 +56,11 @@ CALLFRAME: firstPause
5056
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
5157
- fakeFirstPauseLexicalVariable
5258
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
59+
- arguments
5360
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
5461
- fooLexicalVariable2
5562
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
63+
- arguments
5664
- fooVarVariable1
5765
- firstPause
5866
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -61,8 +69,10 @@ CALLFRAME: firstPause
6169

6270
---- Merged Scope Chain ----
6371
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:19:24)
72+
- arguments
6473
- fakeFirstPauseLexicalVariable
6574
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
75+
- arguments
6676
- fooVarVariable1
6777
- firstPause
6878
- fooLexicalVariable2
@@ -76,6 +86,7 @@ CALLFRAME: entry
7686
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
7787
- fooLexicalVariable2
7888
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
89+
- arguments
7990
- fooVarVariable1
8091
- firstPause
8192
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -84,6 +95,7 @@ CALLFRAME: entry
8495

8596
---- Merged Scope Chain ----
8697
SCOPE: Name (entry) - Type (Local) - Hash (entry:<sourceID>:14:15)
98+
- arguments
8799
- fooVarVariable1
88100
- firstPause
89101
- fooLexicalVariable2
@@ -101,6 +113,7 @@ CALLFRAME: secondPause
101113
SCOPE: Name (secondPause) - Type (Closure) - Hash (secondPause:<sourceID>:6:21)
102114
- shoeLexicalVariable1
103115
SCOPE: Name (secondPause) - Type (Closure) - Hash (secondPause:<sourceID>:6:21)
116+
- arguments
104117
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
105118
- globalLet2
106119
SCOPE: Name () - Type (Global) - Hash ()
@@ -109,6 +122,7 @@ CALLFRAME: secondPause
109122
SCOPE: Name (secondPause) - Type (Block) - Hash (secondPause:<sourceID>:6:21)
110123
- blockLexicalVariable
111124
SCOPE: Name (secondPause) - Type (Local) - Hash (secondPause:<sourceID>:6:21)
125+
- arguments
112126
- shoeLexicalVariable1
113127
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
114128
- globalLet2
@@ -122,15 +136,18 @@ CALLFRAME: firstPause
122136
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
123137
- barLexicalVariable2
124138
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
139+
- arguments
125140
- barVarVariable1
126141
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
127142
- firstPause
128143
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
129144
- fakeFirstPauseLexicalVariable
130145
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
146+
- arguments
131147
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
132148
- fooLexicalVariable2
133149
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
150+
- arguments
134151
- fooVarVariable1
135152
- firstPause
136153
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -141,13 +158,16 @@ CALLFRAME: firstPause
141158
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
142159
- barLexicalVariable2
143160
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:21:29)
161+
- arguments
144162
- barVarVariable1
145163
- barLexicalVariable2
146164
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
147165
- firstPause
148166
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
167+
- arguments
149168
- fakeFirstPauseLexicalVariable
150169
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
170+
- arguments
151171
- fooVarVariable1
152172
- firstPause
153173
- fooLexicalVariable2
@@ -161,9 +181,11 @@ CALLFRAME: firstPause
161181
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
162182
- fakeFirstPauseLexicalVariable
163183
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
184+
- arguments
164185
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
165186
- fooLexicalVariable2
166187
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
188+
- arguments
167189
- fooVarVariable1
168190
- firstPause
169191
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -172,8 +194,10 @@ CALLFRAME: firstPause
172194

173195
---- Merged Scope Chain ----
174196
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:19:24)
197+
- arguments
175198
- fakeFirstPauseLexicalVariable
176199
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
200+
- arguments
177201
- fooVarVariable1
178202
- firstPause
179203
- fooLexicalVariable2
@@ -187,6 +211,7 @@ CALLFRAME: entry
187211
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
188212
- fooLexicalVariable2
189213
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
214+
- arguments
190215
- fooVarVariable1
191216
- firstPause
192217
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -195,6 +220,7 @@ CALLFRAME: entry
195220

196221
---- Merged Scope Chain ----
197222
SCOPE: Name (entry) - Type (Local) - Hash (entry:<sourceID>:14:15)
223+
- arguments
198224
- fooVarVariable1
199225
- firstPause
200226
- fooLexicalVariable2
@@ -210,17 +236,21 @@ CALLFRAME:
210236
SCOPE: Name () - Type (Closure) - Hash (:<sourceID>:36:14)
211237
- localVariableInsideAnonymousFunction
212238
SCOPE: Name () - Type (Closure) - Hash (:<sourceID>:36:14)
239+
- arguments
213240
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
214241
- closureVariableInsideThirdPause
215242
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
243+
- arguments
216244
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
217245
- globalLet2
218246
SCOPE: Name () - Type (Global) - Hash ()
219247

220248
---- Merged Scope Chain ----
221249
SCOPE: Name () - Type (Local) - Hash (:<sourceID>:36:14)
250+
- arguments
222251
- localVariableInsideAnonymousFunction
223252
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
253+
- arguments
224254
- closureVariableInsideThirdPause
225255
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
226256
- globalLet2
@@ -232,12 +262,14 @@ CALLFRAME: thirdPause
232262
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
233263
- closureVariableInsideThirdPause
234264
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
265+
- arguments
235266
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
236267
- globalLet2
237268
SCOPE: Name () - Type (Global) - Hash ()
238269

239270
---- Merged Scope Chain ----
240271
SCOPE: Name (thirdPause) - Type (Local) - Hash (thirdPause:<sourceID>:34:20)
272+
- arguments
241273
- closureVariableInsideThirdPause
242274
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
243275
- globalLet2
@@ -251,15 +283,18 @@ CALLFRAME: firstPause
251283
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
252284
- barLexicalVariable2
253285
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
286+
- arguments
254287
- barVarVariable1
255288
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
256289
- firstPause
257290
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
258291
- fakeFirstPauseLexicalVariable
259292
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
293+
- arguments
260294
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
261295
- fooLexicalVariable2
262296
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
297+
- arguments
263298
- fooVarVariable1
264299
- firstPause
265300
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -270,13 +305,16 @@ CALLFRAME: firstPause
270305
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
271306
- barLexicalVariable2
272307
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:21:29)
308+
- arguments
273309
- barVarVariable1
274310
- barLexicalVariable2
275311
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
276312
- firstPause
277313
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
314+
- arguments
278315
- fakeFirstPauseLexicalVariable
279316
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
317+
- arguments
280318
- fooVarVariable1
281319
- firstPause
282320
- fooLexicalVariable2
@@ -290,9 +328,11 @@ CALLFRAME: firstPause
290328
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
291329
- fakeFirstPauseLexicalVariable
292330
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
331+
- arguments
293332
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
294333
- fooLexicalVariable2
295334
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
335+
- arguments
296336
- fooVarVariable1
297337
- firstPause
298338
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -301,8 +341,10 @@ CALLFRAME: firstPause
301341

302342
---- Merged Scope Chain ----
303343
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:19:24)
344+
- arguments
304345
- fakeFirstPauseLexicalVariable
305346
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
347+
- arguments
306348
- fooVarVariable1
307349
- firstPause
308350
- fooLexicalVariable2
@@ -316,6 +358,7 @@ CALLFRAME: entry
316358
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
317359
- fooLexicalVariable2
318360
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
361+
- arguments
319362
- fooVarVariable1
320363
- firstPause
321364
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
@@ -324,6 +367,7 @@ CALLFRAME: entry
324367

325368
---- Merged Scope Chain ----
326369
SCOPE: Name (entry) - Type (Local) - Hash (entry:<sourceID>:14:15)
370+
- arguments
327371
- fooVarVariable1
328372
- firstPause
329373
- fooLexicalVariable2
@@ -338,13 +382,15 @@ CALLFRAME: pause
338382

339383
---- Scope Chain ----
340384
SCOPE: Name (pause) - Type (Local) - Hash (pause:<sourceID>:7:10)
385+
- arguments
341386
SCOPE: Name (<global>) - Type (Block) - Hash (<global>:<sourceID>:1:1)
342387
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
343388
- globalLet2
344389
SCOPE: Name () - Type (Global) - Hash ()
345390

346391
---- Merged Scope Chain ----
347392
SCOPE: Name (pause) - Type (Local) - Hash (pause:<sourceID>:7:10)
393+
- arguments
348394
SCOPE: Name (<global>) - Type (Block) - Hash (<global>:<sourceID>:1:1)
349395
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
350396
- globalLet2

‎LayoutTests/inspector/debugger/tail-deleted-frames/tail-deleted-frames-scopes-expected.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CALL STACK:
1919
-------------
2020
3: [F] startABC
2121
----Scope----
22-
-- empty --
22+
arguments: Arguments
2323
-------------
2424
4: [P] Global Code
2525
----Scope----

‎LayoutTests/inspector/debugger/tail-deleted-frames/tail-deleted-frames-vm-entry-expected.txt‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,57 @@ PAUSED
77
CALL STACK:
88
0: [F] bar
99
----Scope----
10+
arguments: Arguments
1011
i: 0
1112
-------------
1213
1: -F- bar
1314
----Scope----
15+
arguments: Arguments
1416
i: 1
1517
-------------
1618
2: -F- bar
1719
----Scope----
20+
arguments: Arguments
1821
i: 2
1922
-------------
2023
3: -F- bar
2124
----Scope----
25+
arguments: Arguments
2226
i: 3
2327
-------------
2428
4: -F- bar
2529
----Scope----
30+
arguments: Arguments
2631
i: 4
2732
-------------
2833
5: -F- bar
2934
----Scope----
35+
arguments: Arguments
3036
i: 5
3137
-------------
3238
6: -F- bar
3339
----Scope----
40+
arguments: Arguments
3441
i: 6
3542
-------------
3643
7: -F- bar
3744
----Scope----
45+
arguments: Arguments
3846
i: 7
3947
-------------
4048
8: -F- bar
4149
----Scope----
50+
arguments: Arguments
4251
i: 8
4352
-------------
4453
9: -F- bar
4554
----Scope----
55+
arguments: Arguments
4656
i: 9
4757
-------------
4858
10: -F- timeout
4959
----Scope----
60+
arguments: Arguments
5061
foo: 25
5162
-------------
5263
ASYNC CALL STACK:

0 commit comments

Comments
 (0)