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