Skip to content

Commit db34de0

Browse files
committed
Inline variable/bindings items
1 parent f907201 commit db34de0

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/codec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,9 @@ export interface OriginalScopeStartItem {
4141
kindIdx?: number;
4242
}
4343

44-
export interface OriginalScopeVariablesItem {
45-
variableIdxs: number[];
46-
}
47-
4844
export interface GeneratedRangeStartItem {
4945
flags: number;
5046
line?: number;
5147
column: number;
5248
definitionIdx?: number;
5349
}
54-
55-
export interface GeneratedRangeBindingsItem {
56-
valueIdxs: number[];
57-
}

src/decode/decode.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
// found in the LICENSE file.
44

55
import {
6-
type GeneratedRangeBindingsItem,
76
GeneratedRangeFlags,
87
type GeneratedRangeStartItem,
98
OriginalScopeFlags,
109
type OriginalScopeStartItem,
11-
type OriginalScopeVariablesItem,
1210
Tag,
1311
} from "../codec.ts";
1412
import type {
@@ -121,7 +119,7 @@ class Decoder {
121119
variableIdxs.push(iter.nextSignedVLQ());
122120
}
123121

124-
this.#handleOriginalScopeVariablesItem({ variableIdxs });
122+
this.#handleOriginalScopeVariablesItem(variableIdxs);
125123
break;
126124
}
127125
case Tag.ORIGINAL_SCOPE_END: {
@@ -170,7 +168,7 @@ class Decoder {
170168
valueIdxs.push(iter.nextSignedVLQ());
171169
}
172170

173-
this.#handleGeneratedRangeBindingsItem({ valueIdxs });
171+
this.#handleGeneratedRangeBindingsItem(valueIdxs);
174172
break;
175173
}
176174
}
@@ -236,7 +234,7 @@ class Decoder {
236234
this.#flatOriginalScopes.push(scope);
237235
}
238236

239-
#handleOriginalScopeVariablesItem(item: OriginalScopeVariablesItem) {
237+
#handleOriginalScopeVariablesItem(variableIdxs: number[]) {
240238
const scope = this.#scopeStack.at(-1);
241239
if (!scope) {
242240
this.#throwInStrictMode(
@@ -245,7 +243,7 @@ class Decoder {
245243
return;
246244
}
247245

248-
for (const variableIdx of item.variableIdxs) {
246+
for (const variableIdx of variableIdxs) {
249247
this.#scopeState.variable += variableIdx;
250248
scope.variables.push(this.#names[this.#scopeState.variable]);
251249

@@ -311,7 +309,7 @@ class Decoder {
311309
this.#rangeStack.push(range);
312310
}
313311

314-
#handleGeneratedRangeBindingsItem(item: GeneratedRangeBindingsItem) {
312+
#handleGeneratedRangeBindingsItem(valueIdxs: number[]) {
315313
const range = this.#rangeStack.at(-1);
316314
if (!range) {
317315
this.#throwInStrictMode(
@@ -320,7 +318,7 @@ class Decoder {
320318
return;
321319
}
322320

323-
for (const valueIdx of item.valueIdxs) {
321+
for (const valueIdx of valueIdxs) {
324322
if (valueIdx === -1) {
325323
range.values.push(null);
326324
} else {

0 commit comments

Comments
 (0)