JSAsyncGenerator.cpp [plain text]
#include "config.h"
#include "JSAsyncGenerator.h"
#include "JSCInlines.h"
#include "JSInternalFieldObjectImplInlines.h"
namespace JSC {
const ClassInfo JSAsyncGenerator::s_info = { "AsyncGenerator", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSAsyncGenerator) };
JSAsyncGenerator* JSAsyncGenerator::create(VM& vm, Structure* structure)
{
JSAsyncGenerator* generator = new (NotNull, allocateCell<JSAsyncGenerator>(vm.heap)) JSAsyncGenerator(vm, structure);
generator->finishCreation(vm);
return generator;
}
Structure* JSAsyncGenerator::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
return Structure::create(vm, globalObject, prototype, TypeInfo(JSAsyncGeneratorType, StructureFlags), info());
}
JSAsyncGenerator::JSAsyncGenerator(VM& vm, Structure* structure)
: Base(vm, structure)
{
}
void JSAsyncGenerator::finishCreation(VM& vm)
{
Base::finishCreation(vm);
auto values = initialValues();
ASSERT(values.size() == numberOfInternalFields);
for (unsigned index = 0; index < values.size(); ++index)
internalField(index).set(vm, this, values[index]);
}
void JSAsyncGenerator::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
auto* thisObject = jsCast<JSAsyncGenerator*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
Base::visitChildren(thisObject, visitor);
}
}