summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/FunctionConstructor.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/runtime/FunctionConstructor.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/runtime/FunctionConstructor.h')
-rw-r--r--Source/JavaScriptCore/runtime/FunctionConstructor.h62
1 files changed, 34 insertions, 28 deletions
diff --git a/Source/JavaScriptCore/runtime/FunctionConstructor.h b/Source/JavaScriptCore/runtime/FunctionConstructor.h
index 61443e944..d60dbd365 100644
--- a/Source/JavaScriptCore/runtime/FunctionConstructor.h
+++ b/Source/JavaScriptCore/runtime/FunctionConstructor.h
@@ -18,8 +18,7 @@
*
*/
-#ifndef FunctionConstructor_h
-#define FunctionConstructor_h
+#pragma once
#include "InternalFunction.h"
@@ -29,38 +28,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,
+ Async,
+};
- 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 SourceOrigin&, const String& sourceURL, const WTF::TextPosition&, FunctionConstructionMode = FunctionConstructionMode::Function, JSValue newTarget = JSValue());
+JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, FunctionConstructionMode = FunctionConstructionMode::Function, JSValue newTarget = JSValue());
-} // namespace JSC
+JS_EXPORT_PRIVATE JSObject* constructFunctionSkippingEvalEnabledCheck(
+ ExecState*, JSGlobalObject*, const ArgList&, const Identifier&, const SourceOrigin&,
+ const String&, const WTF::TextPosition&, int overrideLineNumber = -1,
+ FunctionConstructionMode = FunctionConstructionMode::Function, JSValue newTarget = JSValue());
-#endif // FunctionConstructor_h
+} // namespace JSC