Ejemplo n.º 1
0
bool setJSTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(thisValue);
    JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
    if (UNLIKELY(!castedThis)) {
        return throwSetterTypeError(*state, "TestInterface", "supplementalStr2");
    }
    auto& impl = castedThis->wrapped();
    auto nativeValue = value.toWTFString(state);
    if (UNLIKELY(state->hadException()))
        return false;
    WebCore::TestSupplemental::setSupplementalStr2(impl, WTFMove(nativeValue));
    return true;
}
Ejemplo n.º 2
0
bool setJSTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(thisValue);
    JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue));
    if (UNLIKELY(!castedThis)) {
        return throwSetterTypeError(*state, "TestInterface", "supplementalNode");
    }
    auto& impl = castedThis->wrapped();
    auto nativeValue = JSNode::toWrapped(value);
    if (UNLIKELY(!nativeValue)) {
        throwAttributeTypeError(*state, "TestInterface", "supplementalNode", "Node");
        return false;
    }
    WebCore::TestSupplemental::setSupplementalNode(impl, *nativeValue);
    return true;
}