]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/ErrorConstructor.h
JavaScriptCore-7600.1.4.11.8.tar.gz
[apple/javascriptcore.git] / runtime / ErrorConstructor.h
index e3d789b0d60864544ef5b4029fdf9418f06a452c..29283d01b1b043804b05be5d569bf9228f5f6161 100644 (file)
@@ -30,15 +30,31 @@ namespace JSC {
 
     class ErrorConstructor : public InternalFunction {
     public:
-        ErrorConstructor(ExecState*, NonNullPassRefPtr<Structure>, ErrorPrototype*);
+        typedef InternalFunction Base;
 
+        static ErrorConstructor* create(VM& vm, Structure* structure, ErrorPrototype* errorPrototype)
+        {
+            ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(vm.heap)) ErrorConstructor(vm, structure);
+            constructor->finishCreation(vm, errorPrototype);
+            return constructor;
+        }
+
+        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&, ErrorPrototype*);
+        
     private:
-        virtual ConstructType getConstructData(ConstructData&);
-        virtual CallType getCallData(CallData&);
+        ErrorConstructor(VM&, Structure*);
+        static ConstructType getConstructData(JSCell*, ConstructData&);
+        static CallType getCallData(JSCell*, CallData&);
     };
 
-    ErrorInstance* constructError(ExecState*, const ArgList&);
-
 } // namespace JSC
 
 #endif // ErrorConstructor_h