BooleanObject.cpp 545 B

1234567891011121314151617181920212223
  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. NonnullGCPtr<BooleanObject> BooleanObject::create(Realm& realm, bool value)
  10. {
  11. return realm.heap().allocate<BooleanObject>(realm, value, realm.intrinsics().boolean_prototype());
  12. }
  13. BooleanObject::BooleanObject(bool value, Object& prototype)
  14. : Object(ConstructWithPrototypeTag::Tag, prototype)
  15. , m_value(value)
  16. {
  17. }
  18. }