@@ -43,63 +43,63 @@ export interface EventBuffer {
4343}
4444
4545class EventBufferArray implements EventBuffer {
46- private events : RecordingEvent [ ] ;
46+ private _events : RecordingEvent [ ] ;
4747
4848 public constructor ( ) {
49- this . events = [ ] ;
49+ this . _events = [ ] ;
5050 }
5151
5252 public destroy ( ) : void {
53- this . events = [ ] ;
53+ this . _events = [ ] ;
5454 }
5555
5656 public get length ( ) : number {
57- return this . events . length ;
57+ return this . _events . length ;
5858 }
5959
6060 public addEvent ( event : RecordingEvent , isCheckout ?: boolean ) : void {
6161 if ( isCheckout ) {
62- this . events = [ event ] ;
62+ this . _events = [ event ] ;
6363 return ;
6464 }
6565
66- this . events . push ( event ) ;
66+ this . _events . push ( event ) ;
6767 }
6868
6969 public finish ( ) : Promise < string > {
7070 return new Promise < string > ( resolve => {
7171 // Make a copy of the events array reference and immediately clear the
7272 // events member so that we do not lose new events while uploading
7373 // attachment.
74- const eventsRet = this . events ;
75- this . events = [ ] ;
74+ const eventsRet = this . _events ;
75+ this . _events = [ ] ;
7676 resolve ( JSON . stringify ( eventsRet ) ) ;
7777 } ) ;
7878 }
7979}
8080
8181// exporting for testing
8282export class EventBufferCompressionWorker implements EventBuffer {
83- private worker : null | Worker ;
84- private eventBufferItemLength : number = 0 ;
85- private id : number = 0 ;
83+ private _worker : null | Worker ;
84+ private _eventBufferItemLength : number = 0 ;
85+ private _id : number = 0 ;
8686
8787 public constructor ( worker : Worker ) {
88- this . worker = worker ;
88+ this . _worker = worker ;
8989 }
9090
9191 public destroy ( ) : void {
9292 __DEBUG_BUILD__ && logger . log ( '[Replay] Destroying compression worker' ) ;
93- this . worker ?. terminate ( ) ;
94- this . worker = null ;
93+ this . _worker ?. terminate ( ) ;
94+ this . _worker = null ;
9595 }
9696
9797 /**
9898 * Note that this may not reflect what is actually in the event buffer. This
9999 * is only a local count of the buffer size since `addEvent` is async.
100100 */
101101 public get length ( ) : number {
102- return this . eventBufferItemLength ;
102+ return this . _eventBufferItemLength ;
103103 }
104104
105105 public async addEvent ( event : RecordingEvent , isCheckout ?: boolean ) : Promise < string | Uint8Array > {
@@ -138,7 +138,7 @@ export class EventBufferCompressionWorker implements EventBuffer {
138138 }
139139
140140 // At this point, we'll always want to remove listener regardless of result status
141- this . worker ?. removeEventListener ( 'message' , listener ) ;
141+ this . _worker ?. removeEventListener ( 'message' , listener ) ;
142142
143143 if ( ! data . success ) {
144144 // TODO: Do some error handling, not sure what
@@ -161,8 +161,8 @@ export class EventBufferCompressionWorker implements EventBuffer {
161161
162162 // Note: we can't use `once` option because it's possible it needs to
163163 // listen to multiple messages
164- this . worker ?. addEventListener ( 'message' , listener ) ;
165- this . worker ?. postMessage ( { id, method, args : stringifiedArgs } ) ;
164+ this . _worker ?. addEventListener ( 'message' , listener ) ;
165+ this . _worker ?. postMessage ( { id, method, args : stringifiedArgs } ) ;
166166 } ) ;
167167 }
168168
@@ -174,7 +174,7 @@ export class EventBufferCompressionWorker implements EventBuffer {
174174 } ) ;
175175
176176 // XXX: See note in `get length()`
177- this . eventBufferItemLength ++ ;
177+ this . _eventBufferItemLength ++ ;
178178
179179 return promise ;
180180 }
@@ -183,12 +183,12 @@ export class EventBufferCompressionWorker implements EventBuffer {
183183 const promise = this . _postMessage ( { id, method : 'finish' , args : [ ] } ) ;
184184
185185 // XXX: See note in `get length()`
186- this . eventBufferItemLength = 0 ;
186+ this . _eventBufferItemLength = 0 ;
187187
188188 return promise as Promise < Uint8Array > ;
189189 }
190190
191191 private _getAndIncrementId ( ) : number {
192- return this . id ++ ;
192+ return this . _id ++ ;
193193 }
194194}
0 commit comments