You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/scopes.md
+29-8Lines changed: 29 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -132,9 +132,15 @@ interface SourceMap {
132
132
interfaceOriginalScope {
133
133
start:OriginalPosition;
134
134
end:OriginalPosition;
135
-
kind:string;
135
+
/** Serves as a label in source-map consumers */
136
+
kind?:string;
136
137
/** Class/module/function name. Can be used for stack traces or naming scopes in a debugger's scope view */
137
138
name?:string;
139
+
/**
140
+
* Whether this scope corresponds to the semantic equivalent of a function call in
141
+
* the authored language, and as such can show up in stack traces.
142
+
*/
143
+
isStackFrame:boolean;
138
144
/** Symbols defined in this scope */
139
145
variables?:string[];
140
146
children?:OriginalScope[];
@@ -143,7 +149,18 @@ interface OriginalScope {
143
149
interfaceGeneratedRange {
144
150
start:GeneratedPosition;
145
151
end:GeneratedPosition;
146
-
isScope:boolean;
152
+
/**
153
+
* Whether this range is a JavaScript function/method/generator/constructor and can show
154
+
* up in Error.stack as a stack frame.
155
+
*/
156
+
isStackFrame:boolean;
157
+
/**
158
+
* Whether calls to this range should be removed from stack traces.
159
+
* Intended for outlined functions or transpiler inserted function that correspond
160
+
* to an original scope, but should be hidden from stack traces (e.g. an original block
161
+
* scope outlined into a function).
162
+
*/
163
+
isHidden:boolean;
147
164
originalScope?:OriginalScope;
148
165
/** If this scope corresponds to an inlined function body, record the callsite of the inlined function in the original code */
149
166
callsite?:OriginalPosition;
@@ -199,17 +216,20 @@ Note: Each DATA represents one VLQ number.
199
216
* Note: this is the point in the original code where the scope starts. `line` is relative to the `line` of the preceding "start/end original scope" item.
200
217
* DATA column in the original code
201
218
* Note: Column is always absolute.
202
-
* DATA kind offset into `names` field
203
-
* Note: This offset is relative to the offset of the last `kind` or absolute if this is the first `kind`.
204
-
* Note: This is type of the scope.
205
-
* Note: JavaScript implementations should use `'global'`, `'class'`, `'function'`, and `'block'`.
206
-
* DATA field flags
219
+
* DATA flags
207
220
* Note: binary flags that specify if a field is used for this scope.
208
221
* Note: Unknown flags would skip the whole scope.
209
222
* 0x1 has name
223
+
* 0x2 has kind
224
+
* 0x4 is stack frame
210
225
* name: (only exists if `has name` flag is set)
211
226
* DATA offset into `names` field
212
227
* Note: This name should be shown as function name in the stack trace for function scopes.
228
+
* kind: (only exists if `has kind` flag is set)
229
+
* DATA offset into `names` field
230
+
* Note: This offset is relative to the offset of the last `kind` or absolute if this is the first `kind`.
231
+
* Note: This is type of the scope.
232
+
* Note: JavaScript implementations should use `'global'`, `'class'`, `'function'`, and `'block'`.
213
233
* variables:
214
234
* for each variable:
215
235
* DATA offset into `names` field for the original symbol name defined in this scope
@@ -231,7 +251,8 @@ Note: Each DATA represents one VLQ number.
231
251
* Note: Unknown flags would skip the whole scope.
232
252
* 0x1 has definition
233
253
* 0x2 has callsite
234
-
* 0x4 is scope
254
+
* 0x4 is stack frame
255
+
* 0x8 is hidden
235
256
* definition: (only existing if `has definition` flag is set)
236
257
* DATA offset into `sources`
237
258
* Note: This offset is relative to the offset of the last definition or absolute if this is the first definition
0 commit comments