4
4
5
5
import {
6
6
type GeneratedRangeBindingsItem ,
7
- type GeneratedRangeEndItem ,
8
7
GeneratedRangeFlags ,
9
8
type GeneratedRangeStartItem ,
10
- type OriginalScopeEndItem ,
11
9
OriginalScopeFlags ,
12
10
type OriginalScopeStartItem ,
13
11
type OriginalScopeVariablesItem ,
@@ -127,10 +125,10 @@ class Decoder {
127
125
break ;
128
126
}
129
127
case Tag . ORIGINAL_SCOPE_END : {
130
- this . #handleOriginalScopeEndItem( {
131
- line : iter . nextUnsignedVLQ ( ) ,
132
- column : iter . nextUnsignedVLQ ( ) ,
133
- } ) ;
128
+ this . #handleOriginalScopeEndItem(
129
+ iter . nextUnsignedVLQ ( ) ,
130
+ iter . nextUnsignedVLQ ( ) ,
131
+ ) ;
134
132
break ;
135
133
}
136
134
case Tag . GENERATED_RANGE_START : {
@@ -159,12 +157,9 @@ class Decoder {
159
157
: undefined ;
160
158
161
159
if ( maybeColumn !== undefined ) {
162
- this . #handleGeneratedRangeEndItem( {
163
- line : lineOrColumn ,
164
- column : maybeColumn ,
165
- } ) ;
160
+ this . #handleGeneratedRangeEndItem( lineOrColumn , maybeColumn ) ;
166
161
} else {
167
- this . #handleGeneratedRangeEndItem( { column : lineOrColumn } ) ;
162
+ this . #handleGeneratedRangeEndItem( 0 , lineOrColumn ) ;
168
163
}
169
164
break ;
170
165
}
@@ -258,8 +253,8 @@ class Decoder {
258
253
}
259
254
}
260
255
261
- #handleOriginalScopeEndItem( item : OriginalScopeEndItem ) {
262
- this . #scopeState. line += item . line ;
256
+ #handleOriginalScopeEndItem( line : number , column : number ) {
257
+ this . #scopeState. line += line ;
263
258
264
259
const scope = this . #scopeStack. pop ( ) ;
265
260
if ( ! scope ) {
@@ -269,7 +264,7 @@ class Decoder {
269
264
return ;
270
265
}
271
266
272
- scope . end = { line : this . #scopeState. line , column : item . column } ;
267
+ scope . end = { line : this . #scopeState. line , column } ;
273
268
274
269
if ( this . #scopeStack. length > 0 ) {
275
270
const parent = this . #scopeStack. at ( - 1 ) ! ;
@@ -336,12 +331,12 @@ class Decoder {
336
331
}
337
332
}
338
333
339
- #handleGeneratedRangeEndItem( item : GeneratedRangeEndItem ) {
340
- if ( item . line !== undefined ) {
341
- this . #rangeState. line += item . line ;
342
- this . #rangeState. column = item . column ;
334
+ #handleGeneratedRangeEndItem( line : number , column : number ) {
335
+ if ( line !== 0 ) {
336
+ this . #rangeState. line += line ;
337
+ this . #rangeState. column = column ;
343
338
} else {
344
- this . #rangeState. column += item . column ;
339
+ this . #rangeState. column += column ;
345
340
}
346
341
347
342
const range = this . #rangeStack. pop ( ) ;
0 commit comments