MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / asyncCoro<0>

Function asyncCoro<0>

test/embind/test_val_coro.cpp:61–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59
60template <>
61val asyncCoro<0>() {
62 // check that just sleeping works
63 co_await promise_sleep(1);
64 // check that sleeping and receiving value works
65 val v = co_await promise_sleep(1, 12);
66 assert(v.as<int>() == 12);
67 // check that awaiting a subclassed promise works and returns the correct type
68 int x = co_await typed_promise<int>(promise_sleep(1, 23));
69 assert(x == 23);
70 // check that returning value works (checked by JS in tests)
71 co_return 34;
72}
73
74template <size_t N>
75val throwingCoro() {

Callers

nothing calls this directly

Calls 2

promise_sleepFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected