MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / EMSCRIPTEN_BINDINGS

Function EMSCRIPTEN_BINDINGS

test/embind/embind_jspi_test.cpp:63–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63EMSCRIPTEN_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
87EM_ASYNC_JS(void, test, (), {
88 async function check(promise, expected) {

Callers

nothing calls this directly

Calls 4

asyncClass · 0.85
allow_raw_pointersClass · 0.85
functionFunction · 0.50
functionMethod · 0.45

Tested by

no test coverage detected