- JSContextRef execRef = toRef(exec);
- JSObjectRef thisRef = toRef(this);
- JSObjectRef thisObjRef = toRef(thisObj);
-
- int argumentCount = static_cast<int>(args.size());
- Vector<JSValueRef, 16> arguments(argumentCount);
- for (int i = 0; i < argumentCount; i++)
- arguments[i] = toRef(args[i]);
+ JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, globalObject->callbackFunctionStructure(), callback);
+ function->finishCreation(exec->vm(), name);
+ return function;
+}