I tried to run this function (I don't want to use BANanoFetch here)
This is the output after transpilation:
Why only ["text"] here not _response["text"]
Now, there is an error in the console:
I think the problem is in the transpilation of BANanoPromise.RunMethod as if I change to BANanoObject, It works without problem:
B4X:
Private Sub getTimeWait() As BANanoObject 'ignore
Dim fetch As BANanoObject
Dim response As BANanoPromise
fetch.Initialize("fetch")
response = BANano.Await(fetch.Execute(Array("http://worldtimeapi.org/api/timezone/Pacific/Noumea")))
Return BANano.Await(response.RunMethod("text", Null))
End Sub
B4X:
this.gettimewait = async function() {
if (_B == null) _B = this;
var _fetch, _response;
_fetch = null;
_response = null;
_fetch = fetch;
_response = await _fetch("http://worldtimeapi.org/api/timezone/Pacific/Noumea");
return await ["text"]();
};
Why only ["text"] here not _response["text"]
Now, there is an error in the console:
B4X:
Error: ["text"] is not a function
I think the problem is in the transpilation of BANanoPromise.RunMethod as if I change to BANanoObject, It works without problem:
B4X:
Private Sub getTimeWait() As BANanoObject 'ignore
Dim fetch As BANanoObject
Dim response As BANanoObject
fetch.Initialize("fetch")
response = BANano.Await(fetch.Execute(Array("http://worldtimeapi.org/api/timezone/Pacific/Noumea")))
Return BANano.Await(response.RunMethod("text", Null))
End Sub