]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - runtime/FunctionConstructor.h
JavaScriptCore-7600.1.4.15.12.tar.gz
[apple/javascriptcore.git] / runtime / FunctionConstructor.h
index 197f320c2896627872741ebf57ca1e94b0043263..61443e944d8c7e4347b67a6071c66785b211e71c 100644 (file)
 
 #include "InternalFunction.h"
 
+namespace WTF {
+class TextPosition;
+}
+
 namespace JSC {
 
     class FunctionPrototype;
 
     class FunctionConstructor : public InternalFunction {
     public:
-        FunctionConstructor(ExecState*, NonNullPassRefPtr<Structure>, FunctionPrototype*);
+        typedef InternalFunction Base;
+
+        static FunctionConstructor* create(VM& vm, Structure* structure, FunctionPrototype* functionPrototype)
+        {
+            FunctionConstructor* constructor = new (NotNull, allocateCell<FunctionConstructor>(vm.heap)) FunctionConstructor(vm, structure);
+            constructor->finishCreation(vm, functionPrototype);
+            return constructor;
+        }
+
+        DECLARE_INFO;
+
+        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) 
+        { 
+            return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); 
+        }
 
     private:
-        virtual ConstructType getConstructData(ConstructData&);
-        virtual CallType getCallData(CallData&);
+        FunctionConstructor(VM&, Structure*);
+        void finishCreation(VM&, FunctionPrototype*);
+        static ConstructType getConstructData(JSCell*, ConstructData&);
+        static CallType getCallData(JSCell*, CallData&);
     };
 
-    JSObject* constructFunction(ExecState*, const ArgList&, const Identifier& functionName, const UString& sourceURL, int lineNumber);
-    JSObject* constructFunction(ExecState*, const ArgList&);
+    JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const String& sourceURL, const WTF::TextPosition&);
+    JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&);
+
+    JS_EXPORT_PRIVATE JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, const String&, const WTF::TextPosition&);
 
 } // namespace JSC