diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-05-24 08:28:08 +0000 |
commit | a4e969f4965059196ca948db781e52f7cfebf19e (patch) | |
tree | 6ca352808c8fdc52006a0f33f6ae3c593b23867d /Source/JavaScriptCore/runtime/FunctionConstructor.h | |
parent | 41386e9cb918eed93b3f13648cbef387e371e451 (diff) | |
download | WebKitGtk-tarball-a4e969f4965059196ca948db781e52f7cfebf19e.tar.gz |
webkitgtk-2.12.3webkitgtk-2.12.3
Diffstat (limited to 'Source/JavaScriptCore/runtime/FunctionConstructor.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/FunctionConstructor.h | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/Source/JavaScriptCore/runtime/FunctionConstructor.h b/Source/JavaScriptCore/runtime/FunctionConstructor.h index 61443e944..63bc408c4 100644 --- a/Source/JavaScriptCore/runtime/FunctionConstructor.h +++ b/Source/JavaScriptCore/runtime/FunctionConstructor.h @@ -29,37 +29,45 @@ class TextPosition; namespace JSC { - class FunctionPrototype; +class FunctionPrototype; - class FunctionConstructor : public InternalFunction { - public: - typedef InternalFunction Base; +class FunctionConstructor : public InternalFunction { +public: + 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; - } + 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; + DECLARE_INFO; - static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) - { - return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); - } + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } - private: - FunctionConstructor(VM&, Structure*); - void finishCreation(VM&, FunctionPrototype*); - static ConstructType getConstructData(JSCell*, ConstructData&); - static CallType getCallData(JSCell*, 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 String& sourceURL, const WTF::TextPosition&); - JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&); +enum class FunctionConstructionMode { + Function, + Generator, +}; - JS_EXPORT_PRIVATE JSObject* constructFunctionSkippingEvalEnabledCheck(ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, const String&, const WTF::TextPosition&); +JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const String& sourceURL, const WTF::TextPosition&, FunctionConstructionMode = FunctionConstructionMode::Function, JSValue newTarget = JSValue()); +JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, FunctionConstructionMode = FunctionConstructionMode::Function, JSValue newTarget = JSValue()); + +JS_EXPORT_PRIVATE JSObject* constructFunctionSkippingEvalEnabledCheck( + ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, + const String&, const WTF::TextPosition&, int overrideLineNumber = -1, + FunctionConstructionMode = FunctionConstructionMode::Function, JSValue newTarget = JSValue()); } // namespace JSC |