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 {
163163 const valueIdxs : number [ ] = [ ] ;
164164
165165 while ( iter . hasNext ( ) && iter . peek ( ) !== "," ) {
166- valueIdxs . push ( iter . nextSignedVLQ ( ) ) ;
166+ valueIdxs . push ( iter . nextUnsignedVLQ ( ) ) ;
167167 }
168168
169169 this . #handleGeneratedRangeBindingsItem( valueIdxs ) ;
@@ -343,10 +343,10 @@ class Decoder {
343343 }
344344
345345 for ( const valueIdx of valueIdxs ) {
346- if ( valueIdx === - 1 ) {
346+ if ( valueIdx === 0 ) {
347347 range . values . push ( null ) ;
348348 } else {
349- range . values . push ( this . #resolveName( valueIdx ) ) ;
349+ range . values . push ( this . #resolveName( valueIdx - 1 ) ) ;
350350 }
351351 }
352352 }
Original file line number Diff line number Diff line change @@ -204,9 +204,9 @@ export class Encoder {
204204 this . #encodeTag( EncodedTag . GENERATED_RANGE_BINDINGS ) ;
205205 for ( const val of range . values ) {
206206 if ( val === null || val == undefined ) {
207- this . #encodeSigned ( - 1 ) ;
207+ this . #encodeUnsigned ( 0 ) ;
208208 } else if ( typeof val === "string" ) {
209- this . #encodeSigned ( this . #resolveNamesIdx( val ) ) ;
209+ this . #encodeUnsigned ( this . #resolveNamesIdx( val ) + 1 ) ;
210210 } else {
211211 throw new Error ( "Sub-range bindings not implemented yet!" ) ;
212212 }
You can’t perform that action at this time.
0 commit comments