Skip to content

Async JavascriptBinding - Return null instead of empty object for async Task methods #3980

@amaitland

Description

@amaitland

For async Task methods (those without a generic return type) the result passed back to Javascript is effectively {}. Rather than creating an unnecessary object as the method didn't return a result I'm changing the behaviour to return null instead.

Technically this is a breaking change as it changes the behaviour, expecected impact on users is extremely low.

public async Task WaitBeforeReturnAsync(int milliseconds)
{
	await Task.Delay(milliseconds);

	Debug.WriteLine("Delayed in ms:" + milliseconds);
}

Technically the Task returns VoidTaskResult which doesn't have any properties.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions