JSValue jsWebSocketOnopen(ExecState* exec, const Identifier&, const PropertySlot& slot) { JSWebSocket* castedThis = static_cast<JSWebSocket*>(asObject(slot.slotBase())); UNUSED_PARAM(exec); WebSocket* imp = static_cast<WebSocket*>(castedThis->impl()); if (EventListener* listener = imp->onopen()) { if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext())) return jsFunction; } return jsNull(); }
JSValue jsWebSocketOnopen(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebSocket* castedThis = static_cast<JSWebSocket*>(asObject(slotBase)); UNUSED_PARAM(exec); WebSocket* imp = static_cast<WebSocket*>(castedThis->impl()); if (EventListener* listener = imp->onopen()) { if (const JSEventListener* jsListener = JSEventListener::cast(listener)) { if (JSObject* jsFunction = jsListener->jsFunction(imp->scriptExecutionContext())) return jsFunction; } } return jsNull(); }