X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..81345200c95645a1b0d2635520f96ad55dfde63f:/runtime/StringConstructor.h diff --git a/runtime/StringConstructor.h b/runtime/StringConstructor.h index e511f7b..a2c0823 100644 --- a/runtime/StringConstructor.h +++ b/runtime/StringConstructor.h @@ -29,11 +29,35 @@ namespace JSC { class StringConstructor : public InternalFunction { public: - StringConstructor(ExecState*, NonNullPassRefPtr, Structure* prototypeFunctionStructure, StringPrototype*); + typedef InternalFunction Base; - virtual ConstructType getConstructData(ConstructData&); - virtual CallType getCallData(CallData&); + static StringConstructor* create(VM& vm, Structure* structure, StringPrototype* stringPrototype) + { + StringConstructor* constructor = new (NotNull, allocateCell(vm.heap)) StringConstructor(vm, structure); + constructor->finishCreation(vm, stringPrototype); + return constructor; + } + + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + + protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; + + private: + StringConstructor(VM&, Structure*); + void finishCreation(VM&, StringPrototype*); + static ConstructType getConstructData(JSCell*, ConstructData&); + static CallType getCallData(JSCell*, CallData&); + + static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); }; + + JSCell* JSC_HOST_CALL stringFromCharCode(ExecState*, int32_t); } // namespace JSC