@@ -29,7 +29,9 @@ export class JSObjectSpace {
2929 const state = this . _stateBySlot [ slot ] ! ;
3030 const nextState = ( state + 1 ) >>> 0 ;
3131 if ( ( nextState & SLOT_MASK ) === 0 ) {
32- throw new RangeError ( `Reference count overflow at slot ${ slot } ` ) ;
32+ throw new RangeError (
33+ `Reference count overflow at slot ${ slot } ` ,
34+ ) ;
3335 }
3436 this . _stateBySlot [ slot ] = nextState ;
3537 return ( ( nextState & ~ SLOT_MASK ) | slot ) >>> 0 ;
@@ -44,7 +46,9 @@ export class JSObjectSpace {
4446 } else {
4547 newSlot = this . _values . length ;
4648 if ( newSlot > SLOT_MASK ) {
47- throw new RangeError ( `Reference slot overflow: ${ newSlot } exceeds ${ SLOT_MASK } ` ) ;
49+ throw new RangeError (
50+ `Reference slot overflow: ${ newSlot } exceeds ${ SLOT_MASK } ` ,
51+ ) ;
4852 }
4953 state = 1 ;
5054 }
@@ -89,13 +93,20 @@ export class JSObjectSpace {
8993 // Returns the packed state for the slot, after validating the reference.
9094 private _getValidatedSlotState ( reference : ref ) : number {
9195 const slot = reference & SLOT_MASK ;
92- if ( slot === 0 ) throw new ReferenceError ( "Attempted to use invalid reference " + reference ) ;
96+ if ( slot === 0 )
97+ throw new ReferenceError (
98+ "Attempted to use invalid reference " + reference ,
99+ ) ;
93100 const state = this . _stateBySlot [ slot ] ;
94101 if ( state === undefined || ( state & SLOT_MASK ) === 0 ) {
95- throw new ReferenceError ( "Attempted to use invalid reference " + reference ) ;
102+ throw new ReferenceError (
103+ "Attempted to use invalid reference " + reference ,
104+ ) ;
96105 }
97- if ( ( state >>> SLOT_BITS ) !== ( reference >>> SLOT_BITS ) ) {
98- throw new ReferenceError ( "Attempted to use stale reference " + reference ) ;
106+ if ( state >>> SLOT_BITS !== reference >>> SLOT_BITS ) {
107+ throw new ReferenceError (
108+ "Attempted to use stale reference " + reference ,
109+ ) ;
99110 }
100111 return state ;
101112 }
0 commit comments