/* * Copyright (c) 2021-2022, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include namespace JS { GC_DEFINE_ALLOCATOR(PromiseReaction); GC::Ref PromiseReaction::create(VM& vm, Type type, GC::Ptr capability, GC::Ptr handler) { return vm.heap().allocate(type, capability, move(handler)); } PromiseReaction::PromiseReaction(Type type, GC::Ptr capability, GC::Ptr handler) : m_type(type) , m_capability(capability) , m_handler(move(handler)) { } void PromiseReaction::visit_edges(Cell::Visitor& visitor) { Base::visit_edges(visitor); visitor.visit(m_capability); visitor.visit(m_handler); } }