X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/runtime/NumberConstructor.h diff --git a/runtime/NumberConstructor.h b/runtime/NumberConstructor.h index 723c4b2..f8b1f7f 100644 --- a/runtime/NumberConstructor.h +++ b/runtime/NumberConstructor.h @@ -25,34 +25,35 @@ namespace JSC { - class NumberPrototype; - - class NumberConstructor : public InternalFunction { - public: - NumberConstructor(ExecState*, NonNullPassRefPtr, NumberPrototype*); - - virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); - virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); - JSValue getValueProperty(ExecState*, int token) const; - - static const ClassInfo info; - - static PassRefPtr createStructure(JSValue proto) - { - return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount); - } - - enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue }; - - protected: - static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | InternalFunction::StructureFlags; - - private: - virtual ConstructType getConstructData(ConstructData&); - virtual CallType getCallData(CallData&); - - virtual const ClassInfo* classInfo() const { return &info; } - }; +class NumberPrototype; + +class NumberConstructor : public InternalFunction { +public: + typedef InternalFunction Base; + static const unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | ImplementsHasInstance; + + static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype) + { + NumberConstructor* constructor = new (NotNull, allocateCell(vm.heap)) NumberConstructor(vm, structure); + constructor->finishCreation(vm, numberPrototype); + return constructor; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto) + { + return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info()); + } + +protected: + void finishCreation(VM&, NumberPrototype*); + +private: + NumberConstructor(VM&, Structure*); + static ConstructType getConstructData(JSCell*, ConstructData&); + static CallType getCallData(JSCell*, CallData&); +}; } // namespace JSC