File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -366,6 +366,7 @@ if(EMSCRIPTEN)
366366 target_link_libraries (binaryen_js optimized "--closure 1" )
367367 target_link_libraries (binaryen_js optimized "--llvm-lto 1" )
368368 target_link_libraries (binaryen_js debug "--profiling" )
369+ target_link_libraries (binaryen_js debug "-s ASSERTIONS" )
369370 set_property (TARGET binaryen_js PROPERTY CXX_STANDARD 14 )
370371 set_property (TARGET binaryen_js PROPERTY CXX_STANDARD_REQUIRED ON )
371372 install (TARGETS binaryen_js DESTINATION ${CMAKE_INSTALL_BINDIR} )
Original file line number Diff line number Diff line change @@ -2768,6 +2768,12 @@ Module['emitText'] = function(expr) {
27682768} ;
27692769
27702770// Parses a binary to a module
2771+
2772+ // If building with Emscripten ASSERTIONS, there is a property added to
2773+ // Module to guard against users mistakening using the removed readBinary()
2774+ // API. We must defuse that carefully.
2775+ Object . defineProperty ( Module , 'readBinary' , { writable : true } ) ;
2776+
27712777Module [ 'readBinary' ] = function ( data ) {
27722778 var buffer = allocate ( data , 'i8' , ALLOC_NORMAL ) ;
27732779 var ptr = Module [ '_BinaryenModuleRead' ] ( buffer , data . length ) ;
You can’t perform that action at this time.
0 commit comments