X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..81345200c95645a1b0d2635520f96ad55dfde63f:/runtime/BooleanConstructor.h?ds=sidebyside diff --git a/runtime/BooleanConstructor.h b/runtime/BooleanConstructor.h index d9f51ab..177f69e 100644 --- a/runtime/BooleanConstructor.h +++ b/runtime/BooleanConstructor.h @@ -25,19 +25,37 @@ namespace JSC { - class BooleanPrototype; +class BooleanPrototype; - class BooleanConstructor : public InternalFunction { - public: - BooleanConstructor(ExecState*, PassRefPtr, BooleanPrototype*); +class BooleanConstructor : public InternalFunction { +public: + typedef InternalFunction Base; - private: - virtual ConstructType getConstructData(ConstructData&); - virtual CallType getCallData(CallData&); - }; + static BooleanConstructor* create(VM& vm, Structure* structure, BooleanPrototype* booleanPrototype) + { + BooleanConstructor* constructor = new (NotNull, allocateCell(vm.heap)) BooleanConstructor(vm, structure); + constructor->finishCreation(vm, booleanPrototype); + return constructor; + } - JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSValue); - JSObject* constructBoolean(ExecState*, const ArgList&); + DECLARE_INFO; + + static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) + { + return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); + } + +protected: + void finishCreation(VM&, BooleanPrototype*); + +private: + BooleanConstructor(VM&, Structure*); + static ConstructType getConstructData(JSCell*, ConstructData&); + static CallType getCallData(JSCell*, CallData&); +}; + +JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSGlobalObject*, JSValue); +JSObject* constructBoolean(ExecState*, const ArgList&); } // namespace JSC