@@ -210,7 +210,7 @@ var LibraryTracing = {
210210 } ,
211211
212212 emscripten_trace_record_allocation : ( address , size ) => {
213- if ( typeof Module [ 'onMalloc' ] == 'function' ) Module [ 'onMalloc' ] ( address , size ) ;
213+ Module [ 'onMalloc' ] ?. ( address , size ) ;
214214 if ( EmscriptenTrace . postEnabled ) {
215215 var now = EmscriptenTrace . now ( ) ;
216216 EmscriptenTrace . post ( [ EmscriptenTrace . EVENT_ALLOCATE ,
@@ -219,7 +219,7 @@ var LibraryTracing = {
219219 } ,
220220
221221 emscripten_trace_record_reallocation : ( old_address , new_address , size ) => {
222- if ( typeof Module [ 'onRealloc' ] == 'function' ) Module [ 'onRealloc' ] ( old_address , new_address , size ) ;
222+ Module [ 'onRealloc' ] ?. ( old_address , new_address , size ) ;
223223 if ( EmscriptenTrace . postEnabled ) {
224224 var now = EmscriptenTrace . now ( ) ;
225225 EmscriptenTrace . post ( [ EmscriptenTrace . EVENT_REALLOCATE ,
@@ -228,7 +228,7 @@ var LibraryTracing = {
228228 } ,
229229
230230 emscripten_trace_record_free : ( address ) => {
231- if ( typeof Module [ 'onFree' ] == 'function' ) Module [ 'onFree' ] ( address ) ;
231+ Module [ 'onFree' ] ?. ( address ) ;
232232 if ( EmscriptenTrace . postEnabled ) {
233233 var now = EmscriptenTrace . now ( ) ;
234234 EmscriptenTrace . post ( [ EmscriptenTrace . EVENT_FREE ,
@@ -266,7 +266,7 @@ var LibraryTracing = {
266266 }
267267 } ,
268268
269- emscripten_trace_report_off_heap_data : function ( ) {
269+ emscripten_trace_report_off_heap_data : ( ) => {
270270 function openal_audiodata_size ( ) {
271271 if ( typeof AL == 'undefined' || ! AL . currentContext ) {
272272 return 0 ;
0 commit comments