Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eng/testing/scenarios/BuildWasmAppsJobsList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ Wasm.Build.Tests.PreloadingTests
Wasm.Build.Tests.EnvVariablesTests
Wasm.Build.Tests.HttpTests
Wasm.Build.Tests.DiagnosticsTests
Wasm.Build.Tests.FilesToIncludeInFileSystemTests
Wasm.Build.Tests.FilesToIncludeInFileSystemTests
Wasm.Build.Tests.MaxParallelDownloadsTests
3 changes: 2 additions & 1 deletion eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Wasm.Build.Tests.RebuildTests
Wasm.Build.Tests.SatelliteLoadingTests
Wasm.Build.Tests.WasmBuildAppTest
Wasm.Build.Tests.WasmRunOutOfAppBundleTests
Wasm.Build.Tests.WasmTemplateTests
Wasm.Build.Tests.WasmTemplateTests
Wasm.Build.Tests.MaxParallelDownloadsTests
5 changes: 4 additions & 1 deletion src/mono/sample/wasm/browser/wwwroot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function delay(ms) {
try {
const { setModuleImports, getAssemblyExports } = await dotnet
.withConfig({ appendElementOnExit: true, exitOnUnhandledError: true, forwardConsole: true, logExitCode: true })
.withDiagnosticTracing(true)
.create();

setModuleImports("main.js", {
Expand All @@ -32,5 +33,7 @@ try {
exit(exitCode);
}
catch (err) {
exit(2, err);
if (!err || typeof err.status !== "number") {
exit(2, err);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ switch (testCase) {
testOutput("download finished");
break;
case "MaxParallelDownloads":
const maxParallelDownloads = params.get("maxParallelDownloads");
const maxParallelDownloads = parseInt(params.get("maxParallelDownloads"), 10) || 16;
let activeFetchCount = 0;
const originalFetch2 = globalThis.fetch;
globalThis.fetch = async (...args) => {
Expand Down
1 change: 1 addition & 0 deletions src/native/libs/Common/JavaScript/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ set(ROLLUP_TS_SOURCES
"${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/utils/per-module.ts"
"${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/utils/polyfills.ts"
"${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/utils/runtime-list.ts"
"${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/utils/scheduling.ts"
"${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/utils/strings.ts"
"${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/utils/types.ts"

Expand Down
12 changes: 4 additions & 8 deletions src/native/libs/Common/JavaScript/host/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function registerPdbBytes(bytes: Uint8Array, virtualPath: string) {
_ems_.FS.createDataFile(parentDirectory, fileName, bytes, true /* canRead */, true /* canWrite */, true /* canOwn */);
}

export function registerDllBytes(bytes: Uint8Array, virtualPath: string) {
export function registerDllBytes(bytes: Uint8Array, virtualPath: string, shortName: string) {
const sp = _ems_.stackSave();
try {
const ptrPtr = _ems_.stackAlloc(sizeOfPtr);
Expand All @@ -38,13 +38,9 @@ export function registerDllBytes(bytes: Uint8Array, virtualPath: string) {
const ptr = _ems_.HEAPU32[ptrPtr as any >>> 2];
_ems_.HEAPU8.set(bytes, ptr >>> 0);

const name = virtualPath.startsWith(browserVirtualAppBase)
? virtualPath.substring(browserVirtualAppBase.length)
: virtualPath.substring(virtualPath.lastIndexOf("/") + 1);

_ems_.dotnetLogger.debug(`Registered assembly '${virtualPath}' (name: '${name}') at ${ptr.toString(16)} length ${bytes.length}`);
_ems_.dotnetLogger.debug(`Registered assembly '${virtualPath}' (shortName: '${shortName}') at ${ptr.toString(16)} length ${bytes.length}`);
loadedAssemblies.set(virtualPath, { ptr, length: bytes.length });
loadedAssemblies.set(name, { ptr, length: bytes.length });
loadedAssemblies.set(shortName, { ptr, length: bytes.length });
} finally {
_ems_.stackRestore(sp);
}
Expand Down Expand Up @@ -96,7 +92,7 @@ export async function instantiateWebcilModule(webcilPromise: Promise<Response>,
}
}

export function BrowserHost_ExternalAssemblyProbe(pathPtr: CharPtr, outDataStartPtr: VoidPtrPtr, outSize: VoidPtr) {
export function BrowserHost_ExternalAssemblyProbe(pathPtr: CharPtr, outDataStartPtr: VoidPtrPtr, outSize: VoidPtr): boolean {
const path = _ems_.UTF8ToString(pathPtr);
const assembly = loadedAssemblies.get(path);
if (assembly) {
Expand Down
Loading
Loading