X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..93a3786624b2768d89bfa27e46598dc64e2fb70a:/runtime/StringConstructor.h diff --git a/runtime/StringConstructor.h b/runtime/StringConstructor.h index 7d52c69..40e574c 100644 --- a/runtime/StringConstructor.h +++ b/runtime/StringConstructor.h @@ -29,11 +29,36 @@ namespace JSC { class StringConstructor : public InternalFunction { public: - StringConstructor(ExecState*, PassRefPtr, Structure* prototypeFunctionStructure, StringPrototype*); + typedef InternalFunction Base; - virtual ConstructType getConstructData(ConstructData&); - virtual CallType getCallData(CallData&); + static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* stringPrototype) + { + StringConstructor* constructor = new (NotNull, allocateCell(*exec->heap())) StringConstructor(globalObject, structure); + constructor->finishCreation(exec, stringPrototype); + return constructor; + } + + static const ClassInfo s_info; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info); + } + + protected: + static const unsigned StructureFlags = OverridesGetOwnPropertySlot | InternalFunction::StructureFlags; + + private: + StringConstructor(JSGlobalObject*, Structure*); + void finishCreation(ExecState*, StringPrototype*); + static ConstructType getConstructData(JSCell*, ConstructData&); + static CallType getCallData(JSCell*, CallData&); + + static bool getOwnPropertySlot(JSCell*, ExecState*, PropertyName, PropertySlot&); + static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&); }; + + JSCell* JSC_HOST_CALL stringFromCharCode(ExecState*, int32_t); } // namespace JSC