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
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -363,12 +363,12 @@ If a "generated range" contains a callsite, then the range describes an inlined
363
363
```
364
364
generated_range_bindings :=
365
365
'G' // Tag: 0x6 unsigned
366
-
sBINDING+
366
+
uBINDING+
367
367
```
368
368
369
-
`generated_range_bindings` are only valid for generated ranges that have a `sDEFINITION`. The bindings list must be equal in length as the variable list of the original scope the `sDEFINITION` references. `sBINDING+` is a list of indices into the `"names"` field of the source map JSON. Each binding is a JavaScript expression that, when evaluated, produces the **value** of the corresponding variable.
369
+
`generated_range_bindings` are only valid for generated ranges that have a `sDEFINITION`. The bindings list must be equal in length as the variable list of the original scope the `sDEFINITION` references. `uBINDING+` is a list of 1-based indices into the `"names"` field of the source map JSON. Each binding is a JavaScript expression that, when evaluated, produces the **value** of the corresponding variable.
370
370
371
-
`sBINDING+` indices are encoded absolute. To signify that a variable is unavailable, use the index `-1`.
371
+
`uBINDING+` indices are encoded absolute. To signify that a variable is unavailable, use the index `0`.
A variable might not be available through the full generated range, or a different expression is required for parts of the generated range to retrieve a variables value. In this case a generator can use `generated_range_subrange_binding` to encode this.
386
386
387
387
*`uVARIABLE_INDEX` is an index into the corresponding original scopes' variables list. It is encoded relative inside a generated range.
388
-
*`binding_from` are the sub-ranges. The initial value expression for a variable is provided by the `generated_range_bindings` item. The generated position in `binding_from` is the start from which the expression `sBINDING` from `binding_from` needs to be used to retrieve the variables value instead.
389
-
*`sBINDING` is an index into the `"names"` field in the source map JSON. It is relative to previous occurrences (also relative to the last `sBINDING+` in `generated_range_bindings`)
388
+
*`binding_from` are the sub-ranges. The initial value expression for a variable is provided by the `generated_range_bindings` item. The generated position in `binding_from` is the start from which the expression `uBINDING` from `binding_from` needs to be used to retrieve the variables value instead.
389
+
*`uBINDING` is a 1-based absolute index into the `"names"` field in the source map JSON. To indicate that a variable is unavailable, use the index `0`.
390
390
*`uLINE` is relative to the generated range's start line for the first `generated_range_subrange_binding` for a specific variable. Or relative to the previous subrange `uLINE` of the same variable.
391
391
*`uCOLUMN` is relative to the `binding_from`/`generated_range_start``uCOLUMN` if the line of this subrange is the same as the line of the preceding `binding_from`/`generated_range_start` or absolute otherwise.
392
392
393
+
Note: `uBINDING` in `binding_from` and `uBINDING+` in `generated_range_bindings` are both absolute 1-based indices. This means the index `1` (encoded as the unsigned VLQ `B`) refers to the first entry in the `names` array.
0 commit comments