示例#1
0
EncodedJSValue jsSharedWorkerConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSSharedWorker* domObject = jsDynamicCast<JSSharedWorker*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSSharedWorker::getConstructor(exec->vm(), domObject->globalObject()));
}
示例#2
0
EncodedJSValue jsSharedWorkerPort(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSSharedWorker* castedThis = jsDynamicCast<JSSharedWorker*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    SharedWorker& impl = castedThis->impl();
    JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.port()));
    return JSValue::encode(result);
}