Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Wasm: Provide implementation for InternalCall in external project #8303

@yowl

Description

@yowl

To get interoperability with mono WebAssembly, some methods that are InternalCall are needed , such as https://github.com/mono/WebAssembly.JSInterop/blob/9e65a41cf1043ce29c7d722bd3885648a653e734/src/WebAssembly.JSInterop/InternalCalls.cs#L14-L15.

I'm currently working around this with something like

            if (callee.IsInternalCall)
            {
                if (callee.Name == "InvokeJS")
                {
                    var coreRtJsInternalCallsType = _compilation.TypeSystemContext
                        .GetModuleForSimpleName("CoreRT.WebAssembly.Interop")
                        .GetKnownType("CoreRT.WebAssembly.Interop", "InternalCalls");
                    callee = coreRtJsInternalCallsType.GetMethod("InvokeJS", null);
                }

in ILToWebAssemblyImporter.cs, ImportCall but can I do this in a separate dll without substituting the method in Ilc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions