BooleanConstructor.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
  3. * Copyright (C) 2008 Apple Inc. All rights reserved.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. *
  19. */
  20. #ifndef BooleanConstructor_h
  21. #define BooleanConstructor_h
  22. #include "InternalFunction.h"
  23. namespace JSC {
  24. class BooleanPrototype;
  25. class BooleanConstructor : public InternalFunction {
  26. public:
  27. typedef InternalFunction Base;
  28. static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
  29. {
  30. BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
  31. constructor->finishCreation(exec, booleanPrototype);
  32. return constructor;
  33. }
  34. static const ClassInfo s_info;
  35. static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
  36. {
  37. return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info);
  38. }
  39. protected:
  40. void finishCreation(ExecState*, BooleanPrototype*);
  41. private:
  42. BooleanConstructor(JSGlobalObject*, Structure*);
  43. static ConstructType getConstructData(JSCell*, ConstructData&);
  44. static CallType getCallData(JSCell*, CallData&);
  45. };
  46. JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSGlobalObject*, JSValue);
  47. JSObject* constructBoolean(ExecState*, const ArgList&);
  48. } // namespace JSC
  49. #endif // BooleanConstructor_h