diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/runtime/NativeErrorConstructor.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/runtime/NativeErrorConstructor.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/NativeErrorConstructor.h | 72 |
1 files changed, 28 insertions, 44 deletions
diff --git a/Source/JavaScriptCore/runtime/NativeErrorConstructor.h b/Source/JavaScriptCore/runtime/NativeErrorConstructor.h index 740d3f933..16e772d7d 100644 --- a/Source/JavaScriptCore/runtime/NativeErrorConstructor.h +++ b/Source/JavaScriptCore/runtime/NativeErrorConstructor.h @@ -18,63 +18,47 @@ * */ -#ifndef NativeErrorConstructor_h -#define NativeErrorConstructor_h +#pragma once #include "InternalFunction.h" #include "NativeErrorPrototype.h" namespace JSC { - class ErrorInstance; - class FunctionPrototype; - class NativeErrorPrototype; +class ErrorInstance; +class FunctionPrototype; +class NativeErrorPrototype; - class NativeErrorConstructor : public InternalFunction { - public: - typedef InternalFunction Base; +class NativeErrorConstructor : public InternalFunction { +public: + typedef InternalFunction Base; - static NativeErrorConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name) - { - NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(vm, structure); - constructor->finishCreation(vm, globalObject, prototypeStructure, name); - return constructor; - } - - DECLARE_INFO; + static NativeErrorConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name) + { + NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(vm, structure); + constructor->finishCreation(vm, globalObject, prototypeStructure, name); + return constructor; + } - static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) - { - return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); - } + DECLARE_INFO; - Structure* errorStructure() { return m_errorStructure.get(); } + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } - protected: - void finishCreation(VM& vm, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name) - { - Base::finishCreation(vm, name); - ASSERT(inherits(info())); + Structure* errorStructure() { return m_errorStructure.get(); } - NativeErrorPrototype* prototype = NativeErrorPrototype::create(vm, globalObject, prototypeStructure, name, this); +protected: + void finishCreation(VM&, JSGlobalObject*, Structure* prototypeStructure, const String& name); - putDirect(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5 - putDirect(vm, vm.propertyNames->prototype, prototype, DontDelete | ReadOnly | DontEnum); - m_errorStructure.set(vm, this, ErrorInstance::createStructure(vm, globalObject, prototype)); - ASSERT(m_errorStructure); - ASSERT(m_errorStructure->isObject()); - } +private: + NativeErrorConstructor(VM&, Structure*); + static ConstructType getConstructData(JSCell*, ConstructData&); + static CallType getCallData(JSCell*, CallData&); + static void visitChildren(JSCell*, SlotVisitor&); - private: - NativeErrorConstructor(VM&, Structure*); - static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags; - static ConstructType getConstructData(JSCell*, ConstructData&); - static CallType getCallData(JSCell*, CallData&); - static void visitChildren(JSCell*, SlotVisitor&); - - WriteBarrier<Structure> m_errorStructure; - }; + WriteBarrier<Structure> m_errorStructure; +}; } // namespace JSC - -#endif // NativeErrorConstructor_h |