Webassembly passing httprequest object variable

How do I pass the variable returned from Browser.NewXMLHttpRequest to an event handler?
I have tried the following and neither work:
xhttp := Browser.NewXMLHttpRequest;
xhttp.onload := new WebAssemblyDelegate((a) -> DoOnLoad(a));
or
xhttp.onload := new WebAssemblyDelegate((a) -> DoOnLoad(a[0]));

The handler proc being:
procedure DoOnLoad(args: dynamic);
begin
writeLn('Status Text: ’ + args.statusText);
or
writeLn('Status Text: ’ + args.Target.statusText);

Hi, onLoad does not have parameters, you can use:

xhttp.onload := new WebAssemblyDelegate(() -> writeLn('Status Text: ' + xhttp.statusText));