ScopeObject.cpp 497 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibJS/Runtime/ScopeObject.h>
  7. #include <LibJS/Runtime/VM.h>
  8. namespace JS {
  9. ScopeObject::ScopeObject(ScopeObject* parent)
  10. : Object(vm().scope_object_shape())
  11. , m_parent(parent)
  12. {
  13. }
  14. ScopeObject::ScopeObject(GlobalObjectTag tag)
  15. : Object(tag)
  16. {
  17. }
  18. void ScopeObject::visit_edges(Visitor& visitor)
  19. {
  20. Base::visit_edges(visitor);
  21. visitor.visit(m_parent);
  22. }
  23. }