@@ -371,23 +371,11 @@ function exportRuntime() {
371371 const EXPORTED_RUNTIME_METHODS_SET = new Set ( EXPORTED_RUNTIME_METHODS ) ;
372372
373373 // optionally export something.
374- // in ASSERTIONS mode we show a useful error if it is used without
375- // being exported. how we show the message depends on whether it's
376- // a function (almost all of them) or a number.
377374 function maybeExport ( name ) {
378- // HEAP objects are exported separately in updateMemoryViews
379- if ( name . startsWith ( 'HEAP' ) ) {
380- return ;
381- }
382- // if requested to be exported, export it
383- if ( EXPORTED_RUNTIME_METHODS_SET . has ( name ) ) {
384- let exported = name ;
385- // the exported name may differ from the internal name
386- if ( exported . startsWith ( 'FS_' ) ) {
387- // this is a filesystem value, FS.x exported as FS_x
388- exported = 'FS.' + exported . substr ( 3 ) ;
389- }
390- return `Module['${ name } '] = ${ exported } ;` ;
375+ // If requested to be exported, export it. HEAP objects are exported
376+ // separately in updateMemoryViews
377+ if ( EXPORTED_RUNTIME_METHODS_SET . has ( name ) && ! name . startsWith ( 'HEAP' ) ) {
378+ return `Module['${ name } '] = ${ name } ;` ;
391379 }
392380 }
393381
@@ -401,12 +389,6 @@ function exportRuntime() {
401389 'addOnPostRun' ,
402390 'addRunDependency' ,
403391 'removeRunDependency' ,
404- 'FS_createFolder' ,
405- 'FS_createPath' ,
406- 'FS_createLazyFile' ,
407- 'FS_createLink' ,
408- 'FS_createDevice' ,
409- 'FS_readFile' ,
410392 'out' ,
411393 'err' ,
412394 'callMain' ,
@@ -500,6 +482,8 @@ function exportRuntime() {
500482 const results = exports . filter ( ( name ) => name ) ;
501483
502484 if ( ASSERTIONS && ! EXPORT_ALL ) {
485+ // in ASSERTIONS mode we show a useful error if it is used without being
486+ // exported. See `unexportedRuntimeSymbol` in runtime_debug.js.
503487 const unusedLibSymbols = getUnusedLibrarySymbols ( ) ;
504488 if ( unusedLibSymbols . size ) {
505489 results . push ( addMissingLibraryStubs ( unusedLibSymbols ) ) ;
0 commit comments