aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/Strong.h
blob: f39d1c6115c64c8a7090a474d2bb82c38e07841d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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;
};

}