]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/BooleanConstructor.h
JavaScriptCore-1218.tar.gz
[apple/javascriptcore.git] / runtime / BooleanConstructor.h
index fa0d05e5887f10126961f13ac2e811153884222f..760d5d3b195f322179134f2774bb7446b6c7fcf5 100644 (file)
 
 namespace JSC {
 
-    class BooleanPrototype;
+class BooleanPrototype;
 
-    class BooleanConstructor : public InternalFunction {
-    public:
-        BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
+class BooleanConstructor : public InternalFunction {
+public:
+    typedef InternalFunction Base;
 
-    private:
-        virtual ConstructType getConstructData(ConstructData&);
-        virtual CallType getCallData(CallData&);
-    };
+    static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
+    {
+        BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
+        constructor->finishCreation(exec, booleanPrototype);
+        return constructor;
+    }
 
-    JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSGlobalObject*, JSValue);
-    JSObject* constructBoolean(ExecState*, const ArgList&);
+    static const ClassInfo s_info;
+
+    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) 
+    { 
+        return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); 
+    }
+
+protected:
+    void finishCreation(ExecState*, BooleanPrototype*);
+
+private:
+    BooleanConstructor(JSGlobalObject*, Structure*);
+    static ConstructType getConstructData(JSCell*, ConstructData&);
+    static CallType getCallData(JSCell*, CallData&);
+};
+
+JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSGlobalObject*, JSValue);
+JSObject* constructBoolean(ExecState*, const ArgList&);
 
 } // namespace JSC