BooleanObject.cpp 582 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2020, Jack Karamanian <karamanian.jack@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Runtime/BooleanObject.h>
  7. #include <LibJS/Runtime/GlobalObject.h>
  8. namespace JS {
  9. JS_DEFINE_ALLOCATOR(BooleanObject);
  10. NonnullGCPtr<BooleanObject> BooleanObject::create(Realm& realm, bool value)
  11. {
  12. return realm.heap().allocate<BooleanObject>(realm, value, realm.intrinsics().boolean_prototype());
  13. }
  14. BooleanObject::BooleanObject(bool value, Object& prototype)
  15. : Object(ConstructWithPrototypeTag::Tag, prototype)
  16. , m_value(value)
  17. {
  18. }
  19. }