Skip to content

Commit 22976df

Browse files
committed
Manually repair rebase damage
1 parent 09dbdb7 commit 22976df

2 files changed

Lines changed: 18 additions & 29 deletions

File tree

src/mono/wasm/runtime/driver.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,14 @@ mono_wasm_load_runtime (const char *managed_path, int enable_debugging)
313313
{
314314
const char *interp_opts = "";
315315

316-
//monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0);
317-
//monoeg_g_setenv ("MONO_LOG_MASK", "gc", 0);
316+
#ifdef DEBUG
317+
monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0);
318+
monoeg_g_setenv ("MONO_LOG_MASK", "gc", 0);
319+
// Setting this env var allows Diagnostic.Debug to write to stderr. In a browser environment this
320+
// output will be sent to the console. Right now this is the only way to emit debug logging from
321+
// corlib assemblies.
322+
monoeg_g_setenv ("COMPlus_DebugWriteToStdErr", "1", 0);
323+
#endif
318324

319325
mini_parse_debug_option ("top-runtime-invoke-unhandled");
320326

src/mono/wasm/runtime/library_mono.js

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -595,17 +595,6 @@ var MonoSupportLib = {
595595
if (!loaded_cb)
596596
throw new Error ("loaded_cb not provided");
597597

598-
if (args.globalization_mode) {
599-
switch (args.globalization_mode) {
600-
case "icu":
601-
case "invariant":
602-
case "auto":
603-
break;
604-
default:
605-
throw new Error ("Invalid option for globalization_mode: " + args.globalization_mode);
606-
}
607-
}
608-
609598
var pending = file_list.length + runtime_assets.length;
610599
var loaded_files = [];
611600
var loaded_runtime_assets = {};
@@ -662,7 +651,7 @@ var MonoSupportLib = {
662651
MONO.loaded_files = loaded_files;
663652
MONO.loaded_runtime_assets = loaded_runtime_assets;
664653

665-
MONO._mono_wasm_globalization_init (args, loaded_runtime_assets);
654+
MONO._globalization_init (args, loaded_runtime_assets);
666655

667656
var load_runtime = Module.cwrap ('mono_wasm_load_runtime', null, ['string', 'number']);
668657

@@ -710,8 +699,7 @@ var MonoSupportLib = {
710699

711700
onPendingRequestComplete ();
712701
} catch (exc) {
713-
console.log ("Unhandled exception in processFetchResponseBuffer", exc);
714-
throw exc;
702+
console.log ("Unhandled exception", exc);
715703
}
716704
};
717705

@@ -733,15 +721,9 @@ var MonoSupportLib = {
733721

734722
attemptNextSource = function (file_name) {
735723
if (sourceIndex >= runtime_asset_sources.length) {
736-
var msg = "MONO-WASM: Failed to load asset: '" + file_name + "' after attempting all sources";
724+
console.log ("MONO_WASM: Failed to load " + file_name);
737725
--pending;
738-
739-
if (MONO.mono_wasm_ignore_asset_load_errors)
740-
console.error (msg);
741-
else
742-
throw new Error (msg);
743-
744-
return;
726+
throw new Error ("MONO-WASM: Failed to load asset: '" + file_name + "' after attempting all sources");
745727
}
746728

747729
var sourcePrefix = runtime_asset_sources[sourceIndex];
@@ -768,8 +750,9 @@ var MonoSupportLib = {
768750
// We'll just skip that file and continue (though the 404 is logged in the console).
769751
if (response.status === 404 && file_name.match (/\.pdb$/) && MONO.mono_wasm_ignore_pdb_load_errors) {
770752
--pending;
771-
console.error ("MONO-WASM: Skipping failed load for .pdb file: '" + file_name + "'");
772-
} else {
753+
throw new Error ("MONO-WASM: Skipping failed load for .pdb file: '" + file_name + "'");
754+
}
755+
else {
773756
throw new Error ("MONO_WASM: Failed to load file: '" + file_name + "'");
774757
}
775758
}
@@ -786,7 +769,7 @@ var MonoSupportLib = {
786769
});
787770
},
788771

789-
_mono_wasm_globalization_init: function (args, assets) {
772+
_globalization_init: function (args, assets) {
790773
var invariantMode = false;
791774

792775
if (args.globalization_mode === "invariant")
@@ -800,12 +783,12 @@ var MonoSupportLib = {
800783
var mono_wasm_load_icu_data = Module.cwrap ('mono_wasm_load_icu_data', 'number', ['number']);
801784
var result = mono_wasm_load_icu_data (icudt[0]);
802785
if (result !== 1)
803-
console.error ("MONO_WASM: mono_wasm_load_icu_data returned", result);
786+
console.log ("MONO_WASM: mono_wasm_load_icu_data returned", result);
804787
} else if (args.globalization_mode !== "icu") {
805788
console.log ("MONO_WASM: icudt.dat not present, using invariant globalization mode");
806789
invariantMode = true;
807790
} else {
808-
console.error ("MONO_WASM: icudt.dat not found and invariant globalization mode is inactive.");
791+
console.log ("MONO_WASM: ERROR: icudt.dat not found and invariant globalization mode is inactive.");
809792
}
810793
}
811794

0 commit comments

Comments
 (0)