Skip to content

wasm InvokeJS return value is broken #61192

@kg

Description

@kg

Description

The transition to using a custom closure instead of eval broke the return value of InvokeJS.

Reproduction Steps

        var res = Interop.Runtime.InvokeJS(@"1 + 2", out int exceptionalResult);
        if (exceptionalResult != 0)
            throw new Exception("InvokeJS failed " + res);
        else if (res != "3")
            throw new Exception("InvokeJS returned invalid result " + res);

Expected behavior

Doesn't throw

Actual behavior

Throws, exception message indicates there was no return value

Regression?

Yes

Known Workarounds

If you put 'return' in the JS expression it may work

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions