Exemplo n.º 1
0
void setJSEventSourceOnerror(ExecState* exec, JSObject* thisObject, JSValue value)
{
    UNUSED_PARAM(exec);
    EventSource* imp = static_cast<EventSource*>(static_cast<JSEventSource*>(thisObject)->impl());
    JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(imp->scriptExecutionContext(), exec);
    if (!globalObject)
        return;
    imp->setOnerror(globalObject->createJSAttributeEventListener(value));
}
Exemplo n.º 2
0
JSValue jsEventSourceOnerror(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    JSEventSource* castedThis = static_cast<JSEventSource*>(asObject(slot.slotBase()));
    UNUSED_PARAM(exec);
    EventSource* imp = static_cast<EventSource*>(castedThis->impl());
    if (EventListener* listener = imp->onerror()) {
        if (JSObject* jsFunction = listener->jsFunction(imp->scriptExecutionContext()))
            return jsFunction;
    }
    return jsNull();
}