AV6
AV6
DDeno
Created by AV6 on 7/26/2023 in #help
rusty_v8 extracting stack trace when a promise rejects
that doesnt seem to work. Tried it, it just gives out None
4 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
thanks a lot!
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
asked here, got the answer!
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
this result above is giving result.is_promise() true. which i expect it to. But i do not understand why it is always in pending scope.perform_microtask_checkpoint(); i tried running this as well.
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
if i make the above js function sync (just removing the async) then the whole thing works, i get the result string "helloworld" out. so the function call works.
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
thats how i got the result promise which i am expecting will resolve to "helloworld"
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
this main function is being called from rust
let result = function.call(scope, recv, &[]).expect("couldnt run");
let result = function.call(scope, recv, &[]).expect("couldnt run");
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
it was
async function main() {
return "helloworld"
}
async function main() {
return "helloworld"
}
yea!, thats what is puzzling me. promise.state() is Pending, i tried pumping the loop as well in a while loop
while v8::Platform::pump_message_loop(&v8::V8::get_current_platform(), scope, false) {
// do nothing
}
while v8::Platform::pump_message_loop(&v8::V8::get_current_platform(), scope, false) {
// do nothing
}
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
something like an "await" version in rust
21 replies
DDeno
Created by AV6 on 6/30/2023 in #help
calling a javascript function and waiting for the promise with `rusty_v8`
i am using rusty_v8. But i am unsure how to handle the event loop here. is it possible to get the value synchronously? or do you have any examples which i can refer to? i have the result: Local<Value> which is a promise (result.is_promise is true). what i am trying to do is let value = get_inner_value_synchronously(result) . is this possible?
21 replies