aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/OnigurumaRegExp.h
blob: 846ca6357b0f793201b8d780e0d7a5e67ec79a9f (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once

#include "root.h"
#include "BunBuiltinNames.h"
#include "BunClientData.h"
#include "ZigGlobalObject.h"
#include "JavaScriptCore/JSDestructibleObjectHeapCellType.h"

extern "C" JSC::EncodedJSValue jsFunctionGetOnigurumaRegExpConstructor(JSC::JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, JSC::PropertyName attributeName);

namespace Zig {

using namespace JSC;
using namespace WebCore;

class OnigurumaRegExpConstructor final : public JSC::InternalFunction {
public:
    using Base = JSC::InternalFunction;
    static OnigurumaRegExpConstructor* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, JSValue prototype);

    // Must be defined for each specialization class.
    static JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES construct(JSC::JSGlobalObject*, JSC::CallFrame*);
    DECLARE_EXPORT_INFO;

    static JSC::Structure* createClassStructure(JSC::JSGlobalObject*, JSC::JSValue prototype);
    static JSC::JSObject* createPrototype(JSC::JSGlobalObject*);
    
    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
    {
        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::InternalFunctionType, StructureFlags), info());
    }


private:
    OnigurumaRegExpConstructor(JSC::VM& vm, JSC::Structure* structure, JSC::NativeFunction nativeFunction)
            : Base(vm, structure, nativeFunction, nativeFunction)
    
        {
        }
    

    void finishCreation(JSC::VM&, JSValue prototype);
};



}