Skip to content

Commit

Permalink
Scopes: Update kind to be an arbitrary string in the names field (#…
Browse files Browse the repository at this point in the history
…107)

Update `kind` to be an arbitrary string in the `names` field.
  • Loading branch information
jridgewell authored Jul 22, 2024
1 parent cec8ef5 commit afb0b37
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions proposals/scopes.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ interface SourceMap {
interface OriginalScope {
start: OriginalPosition;
end: OriginalPosition;
kind: ScopeKind;
kind: string;
/** Class/module/function name. Can be used for stack traces or naming scopes in a debugger's scope view */
name?: string;
/** Symbols defined in this scope */
Expand All @@ -152,8 +152,6 @@ interface GeneratedRange {
children?: GeneratedRange[];
}

type ScopeKind = 'global' | 'class' | 'function' | 'block';

interface BindingRange {
from: GeneratedPosition;
to: GeneratedPosition;
Expand Down Expand Up @@ -194,12 +192,10 @@ Note: Each DATA represents one VLQ number.
* 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.
* DATA column in the original code
* Note: Column is always absolute.
* DATA kind
* DATA kind offset into `names` field
* Note: This offset is relative to the offset of the last `kind` or absolute if this is the first `kind`.
* Note: This is type of the scope.
* 0x1 toplevel
* 0x2 function
* 0x3 class
* 0x4 block
* Note: JavaScript implementations should use `'global'`, `'class'`, `'function'`, and `'block'`.
* DATA field flags
* Note: binary flags that specify if a field is used for this scope.
* Note: Unknown flags would skip the whole scope.
Expand Down

0 comments on commit afb0b37

Please sign in to comment.