| 61 | } |
| 62 | |
| 63 | EMSCRIPTEN_BINDINGS(xxx) { |
| 64 | function("voidFunc", &voidFunc, async()); |
| 65 | function("intFunc", &intFunc, async()); |
| 66 | function("unsuspend", &unsuspend); |
| 67 | function("suspend", &suspend, async()); |
| 68 | function("asyncGetMyClass", &asyncGetMyClass, allow_raw_pointers(), async()); |
| 69 | |
| 70 | class_<MyClass>("MyClass") |
| 71 | .constructor<>() |
| 72 | .function("voidMethod", &MyClass::voidMethod, async()) |
| 73 | .function("intMethod", &MyClass::intMethod, async()) |
| 74 | .function("stdMethod", |
| 75 | std::function<int(const MyClass&, int)>(&stdFunction), |
| 76 | async()) |
| 77 | .function("lambdaMethod", |
| 78 | select_overload<int(MyClass&, int)>([](MyClass& self, int i) { |
| 79 | emscripten_sleep(0); |
| 80 | return i + 1; |
| 81 | }), |
| 82 | async()) |
| 83 | .class_function("voidClass", &MyClass::voidClass, async()) |
| 84 | .class_function("intClass", &MyClass::intClass, async()); |
| 85 | } |
| 86 | |
| 87 | EM_ASYNC_JS(void, test, (), { |
| 88 | async function check(promise, expected) { |
nothing calls this directly
no test coverage detected