X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/14957cd040308e3eeec43d26bae5d76da13fcd85..refs/heads/master:/runtime/FunctionConstructor.h diff --git a/runtime/FunctionConstructor.h b/runtime/FunctionConstructor.h index ba112b9..22ecb57 100644 --- a/runtime/FunctionConstructor.h +++ b/runtime/FunctionConstructor.h @@ -23,23 +23,45 @@ #include "InternalFunction.h" +namespace WTF { +class TextPosition; +} + namespace JSC { - class FunctionPrototype; +class FunctionPrototype; + +class FunctionConstructor : public InternalFunction { +public: + typedef InternalFunction Base; + + static FunctionConstructor* create(VM& vm, Structure* structure, FunctionPrototype* functionPrototype) + { + FunctionConstructor* constructor = new (NotNull, allocateCell(vm.heap)) FunctionConstructor(vm, structure); + constructor->finishCreation(vm, functionPrototype); + return constructor; + } + + DECLARE_INFO; - class FunctionConstructor : public InternalFunction { - public: - FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*); + 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&); - }; +private: + FunctionConstructor(VM&, Structure*); + void finishCreation(VM&, FunctionPrototype*); + static ConstructType getConstructData(JSCell*, ConstructData&); + static CallType getCallData(JSCell*, CallData&); +}; - JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const UString& sourceURL, int lineNumber); - JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&); +JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const String& sourceURL, const WTF::TextPosition&); +JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&); - JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, const UString&, int lineNumber); +JS_EXPORT_PRIVATE JSObject* constructFunctionSkippingEvalEnabledCheck( + ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, + const String&, const WTF::TextPosition&, int overrideLineNumber = -1); } // namespace JSC