JSGeneratorFunction.cpp [plain text]
#include "config.h"
#include "JSGeneratorFunction.h"
#include "Error.h"
#include "JSCInlines.h"
#include "JSCJSValue.h"
#include "JSFunction.h"
#include "JSFunctionInlines.h"
#include "JSObject.h"
#include "PropertySlot.h"
#include "VM.h"
namespace JSC {
const ClassInfo JSGeneratorFunction::s_info = { "GeneratorFunction", &Base::s_info, nullptr, CREATE_METHOD_TABLE(JSGeneratorFunction) };
JSGeneratorFunction::JSGeneratorFunction(VM& vm, FunctionExecutable* executable, JSScope* scope)
: Base(vm, executable, scope, scope->globalObject()->generatorFunctionStructure())
{
}
JSGeneratorFunction* JSGeneratorFunction::createImpl(VM& vm, FunctionExecutable* executable, JSScope* scope)
{
JSGeneratorFunction* generatorFunction = new (NotNull, allocateCell<JSGeneratorFunction>(vm.heap)) JSGeneratorFunction(vm, executable, scope);
ASSERT(generatorFunction->structure()->globalObject());
generatorFunction->finishCreation(vm);
return generatorFunction;
}
JSGeneratorFunction* JSGeneratorFunction::create(VM& vm, FunctionExecutable* executable, JSScope* scope)
{
JSGeneratorFunction* generatorFunction = createImpl(vm, executable, scope);
executable->singletonFunction()->notifyWrite(vm, generatorFunction, "Allocating a generator function");
return generatorFunction;
}
JSGeneratorFunction* JSGeneratorFunction::createWithInvalidatedReallocationWatchpoint(VM& vm, FunctionExecutable* executable, JSScope* scope)
{
return createImpl(vm, executable, scope);
}
}