Skip to content

Commit

Permalink
Change to older version of the runtime.js code
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdageek committed Jun 23, 2021
1 parent e1d49f0 commit 15fc697
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ <h3 id="header">Wasm Browser Sample</h3>
},
};
</script>
<script type="text/javascript" src="mono-config.js"></script>
<script type="text/javascript" src="runtime.js"></script>

<script defer src="dotnet.js"></script>
Expand Down
25 changes: 6 additions & 19 deletions src/tests/FunctionalTests/WebAssembly/Browser/HotReload/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,30 @@
// The .NET Foundation licenses this file to you under the MIT license.

var Module = {

config: null,

preInit: async function() {
Module.config = await MONO.mono_wasm_load_config("./mono-config.json");
},

onRuntimeInitialized: function () {
if (!Module.config || Module.config.error) {
console.log("No config found");
test_exit(1);
throw(Module.config.error);
}

Module.config.loaded_cb = function () {
config.loaded_cb = function () {
try {
App.init ();
} catch (error) {
test_exit(1);
throw (error);
}
};
Module.config.fetch_file_cb = function (asset) {
config.fetch_file_cb = function (asset) {
return fetch (asset, { credentials: 'same-origin' });
}

if (Module.config.environment_variables !== undefined) {
console.log ("expected environment variables to be undefined, but they're: ", Module.config.environment_variables);
if (config.environment_variables !== undefined) {
console.log ("expected environment variables to be undefined, but they're: ", config.environment_variables);
test_exit(1);
}
Module.config.environment_variables = {
config.environment_variables = {
"DOTNET_MODIFIABLE_ASSEMBLIES": "debug"
};

try
{
MONO.mono_load_runtime_and_bcl_args (Module.config);
MONO.mono_load_runtime_and_bcl_args (config);
} catch (error) {
test_exit(1);
throw(error);
Expand Down

0 comments on commit 15fc697

Please sign in to comment.