summaryrefslogtreecommitdiffstats
path: root/js/src/wasm/WasmJS.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/wasm/WasmJS.h')
-rw-r--r--js/src/wasm/WasmJS.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/wasm/WasmJS.h b/js/src/wasm/WasmJS.h
index 27d49701a9..3ebc2d9705 100644
--- a/js/src/wasm/WasmJS.h
+++ b/js/src/wasm/WasmJS.h
@@ -503,6 +503,30 @@ class WasmNamespaceObject : public NativeObject {
extern const JSClass WasmFunctionClass;
+bool IsWasmSuspendingObject(JSObject* obj);
+
+#ifdef ENABLE_WASM_JSPI
+
+class WasmSuspendingObject : public NativeObject {
+ public:
+ static const ClassSpec classSpec_;
+ static const JSClass class_;
+ static const JSClass& protoClass_;
+ static const unsigned WRAPPED_FN_SLOT = 0;
+ static const unsigned RESERVED_SLOTS = 1;
+ static bool construct(JSContext*, unsigned, Value*);
+
+ JSObject* wrappedFunction() const {
+ return getReservedSlot(WRAPPED_FN_SLOT).toObjectOrNull();
+ }
+ void setWrappedFunction(HandleObject fn) {
+ return setReservedSlot(WRAPPED_FN_SLOT, ObjectValue(*fn));
+ }
+};
+
+JSObject* MaybeUnwrapSuspendingObject(JSObject* wrapper);
+#endif
+
} // namespace js
#endif // wasm_js_h