JSCallbackObject<JSGlobalObject>* JSCallbackObject<JSGlobalObject>::create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure) { JSCallbackObject<JSGlobalObject>* callbackObject = new (NotNull, allocateCell<JSCallbackObject<JSGlobalObject> >(globalData.heap)) JSCallbackObject(globalData, classRef, structure); callbackObject->finishCreation(globalData); globalData.heap.addFinalizer(callbackObject, destroy); return callbackObject; }
JSCallbackObject<JSGlobalObject>* JSCallbackObject<JSGlobalObject>::create(VM& vm, JSClassRef classRef, Structure* structure) { JSCallbackObject<JSGlobalObject>* callbackObject = new (NotNull, allocateCell<JSCallbackObject<JSGlobalObject>>(vm.heap)) JSCallbackObject(vm, classRef, structure); callbackObject->finishCreation(vm); vm.heap.addFinalizer(callbackObject, destroy); return callbackObject; }
JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data) { ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); if (!jsClass) return toRef(constructEmptyObject(exec)); JSCallbackObject<JSNonFinalObject>* object = JSCallbackObject<JSNonFinalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); if (JSObject* prototype = jsClass->prototype(exec)) object->setPrototype(exec->globalData(), prototype); return toRef(object); }
JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data) { ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); if (!jsClass) return toRef(new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure())); // slightly more efficient JSCallbackObject<JSObject>* object = new (exec) JSCallbackObject<JSObject>(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); if (JSObject* prototype = jsClass->prototype(exec)) object->setPrototype(prototype); return toRef(object); }
JSObjectRef JSObjectMake(JSContextRef ctx, JSClassRef jsClass, void* data) { if (!ctx) { ASSERT_NOT_REACHED(); return 0; } ExecState* exec = toJS(ctx); APIEntryShim entryShim(exec); if (!jsClass) return toRef(constructEmptyObject(exec)); JSCallbackObject<JSDestructibleObject>* object = JSCallbackObject<JSDestructibleObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); if (JSObject* prototype = jsClass->prototype(exec)) object->setPrototype(exec->vm(), prototype); return toRef(object); }