aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/Strong.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/Strong.h')
-rw-r--r--src/bun.js/bindings/Strong.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bun.js/bindings/Strong.h b/src/bun.js/bindings/Strong.h
new file mode 100644
index 000000000..f39d1c611
--- /dev/null
+++ b/src/bun.js/bindings/Strong.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "root.h"
+#include "JavaScriptCore/Strong.h"
+
+namespace Bun {
+
+// We tried to pool these
+// But it was very complicated
+class StrongRef {
+ WTF_MAKE_ISO_ALLOCATED(StrongRef);
+
+public:
+ StrongRef(JSC::VM& vm, JSC::JSValue value)
+ : m_cell(vm, value)
+ {
+ }
+
+ StrongRef()
+ : m_cell()
+ {
+ }
+
+ JSC::Strong<JSC::Unknown> m_cell;
+};
+
+} \ No newline at end of file