EncodedJSValue jsTestNodeName(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName) { UNUSED_PARAM(state); UNUSED_PARAM(slotBase); UNUSED_PARAM(thisValue); JSTestNode* castedThis = jsDynamicCast<JSTestNode*>(JSValue::decode(thisValue)); if (UNLIKELY(!castedThis)) return throwGetterTypeError(*state, "TestNode", "name"); auto& impl = castedThis->wrapped(); JSValue result = jsStringWithCache(state, impl.name()); return JSValue::encode(result); }
bool setJSTestNodeName(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) { JSValue value = JSValue::decode(encodedValue); UNUSED_PARAM(thisValue); JSTestNode* castedThis = jsDynamicCast<JSTestNode*>(JSValue::decode(thisValue)); if (UNLIKELY(!castedThis)) { return throwSetterTypeError(*state, "TestNode", "name"); } auto& impl = castedThis->wrapped(); auto nativeValue = value.toWTFString(state); if (UNLIKELY(state->hadException())) return false; impl.setName(WTFMove(nativeValue)); return true; }
void setJSTestNodeName(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) { JSValue value = JSValue::decode(encodedValue); UNUSED_PARAM(baseObject); JSTestNode* castedThis = jsDynamicCast<JSTestNode*>(JSValue::decode(thisValue)); if (UNLIKELY(!castedThis)) { throwSetterTypeError(*state, "TestNode", "name"); return; } auto& impl = castedThis->wrapped(); String nativeValue = value.toString(state)->value(state); if (UNLIKELY(state->hadException())) return; impl.setName(nativeValue); }