void setJSTestGenerateIsReachableConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) { JSValue value = JSValue::decode(encodedValue); JSTestGenerateIsReachablePrototype* domObject = jsDynamicCast<JSTestGenerateIsReachablePrototype*>(JSValue::decode(thisValue)); if (UNLIKELY(!domObject)) { throwVMTypeError(state); return; } // Shadowing a built-in constructor domObject->putDirect(state->vm(), state->propertyNames().constructor, value); }
bool setJSTestGenerateIsReachableConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) { VM& vm = state->vm(); auto throwScope = DECLARE_THROW_SCOPE(vm); JSValue value = JSValue::decode(encodedValue); JSTestGenerateIsReachablePrototype* domObject = jsDynamicDowncast<JSTestGenerateIsReachablePrototype*>(JSValue::decode(thisValue)); if (UNLIKELY(!domObject)) { throwVMTypeError(state, throwScope); return false; } // Shadowing a built-in constructor return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); }