File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ class Decoder {
163
163
const valueIdxs : number [ ] = [ ] ;
164
164
165
165
while ( iter . hasNext ( ) && iter . peek ( ) !== "," ) {
166
- valueIdxs . push ( iter . nextSignedVLQ ( ) ) ;
166
+ valueIdxs . push ( iter . nextUnsignedVLQ ( ) ) ;
167
167
}
168
168
169
169
this . #handleGeneratedRangeBindingsItem( valueIdxs ) ;
@@ -343,10 +343,10 @@ class Decoder {
343
343
}
344
344
345
345
for ( const valueIdx of valueIdxs ) {
346
- if ( valueIdx === - 1 ) {
346
+ if ( valueIdx === 0 ) {
347
347
range . values . push ( null ) ;
348
348
} else {
349
- range . values . push ( this . #resolveName( valueIdx ) ) ;
349
+ range . values . push ( this . #resolveName( valueIdx - 1 ) ) ;
350
350
}
351
351
}
352
352
}
Original file line number Diff line number Diff line change @@ -204,9 +204,9 @@ export class Encoder {
204
204
this . #encodeTag( EncodedTag . GENERATED_RANGE_BINDINGS ) ;
205
205
for ( const val of range . values ) {
206
206
if ( val === null || val == undefined ) {
207
- this . #encodeSigned ( - 1 ) ;
207
+ this . #encodeUnsigned ( 0 ) ;
208
208
} else if ( typeof val === "string" ) {
209
- this . #encodeSigned ( this . #resolveNamesIdx( val ) ) ;
209
+ this . #encodeUnsigned ( this . #resolveNamesIdx( val ) + 1 ) ;
210
210
} else {
211
211
throw new Error ( "Sub-range bindings not implemented yet!" ) ;
212
212
}
You can’t perform that action at this time.
0 commit comments