class JSTestCustomNamedGetterPrototype : public JSC::JSNonFinalObject {
public:
- typedef JSC::JSNonFinalObject Base;
+ using Base = JSC::JSNonFinalObject;
static JSTestCustomNamedGetterPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSTestCustomNamedGetterPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestCustomNamedGetterPrototype>(vm.heap)) JSTestCustomNamedGetterPrototype(vm, globalObject, structure);
void finishCreation(JSC::VM&);
};
-typedef JSDOMConstructorNotConstructable<JSTestCustomNamedGetter> JSTestCustomNamedGetterConstructor;
+using JSTestCustomNamedGetterConstructor = JSDOMConstructorNotConstructable<JSTestCustomNamedGetter>;
template<> JSValue JSTestCustomNamedGetterConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
{
if (thisObject->classInfo() == info()) {
JSValue value;
if (thisObject->nameGetter(state, propertyName, value)) {
- slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum, value);
+ slot.setValue(thisObject, ReadOnly | DontEnum, value);
return true;
}
}
EncodedJSValue jsTestCustomNamedGetterConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
JSTestCustomNamedGetterPrototype* domObject = jsDynamicCast<JSTestCustomNamedGetterPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject))
- return throwVMTypeError(state);
+ return throwVMTypeError(state, throwScope);
return JSValue::encode(JSTestCustomNamedGetter::getConstructor(state->vm(), domObject->globalObject()));
}
bool setJSTestCustomNamedGetterConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
JSValue value = JSValue::decode(encodedValue);
JSTestCustomNamedGetterPrototype* domObject = jsDynamicCast<JSTestCustomNamedGetterPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject)) {
- throwVMTypeError(state);
+ throwVMTypeError(state, throwScope);
return false;
}
// Shadowing a built-in constructor
EncodedJSValue JSC_HOST_CALL jsTestCustomNamedGetterPrototypeFunctionAnotherFunction(ExecState* state)
{
+ VM& vm = state->vm();
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ UNUSED_PARAM(throwScope);
JSValue thisValue = state->thisValue();
auto castedThis = jsDynamicCast<JSTestCustomNamedGetter*>(thisValue);
if (UNLIKELY(!castedThis))
- return throwThisTypeError(*state, "TestCustomNamedGetter", "anotherFunction");
+ return throwThisTypeError(*state, throwScope, "TestCustomNamedGetter", "anotherFunction");
ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestCustomNamedGetter::info());
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
- return throwVMError(state, createNotEnoughArgumentsError(state));
- auto str = state->argument(0).toWTFString(state);
- if (UNLIKELY(state->hadException()))
- return JSValue::encode(jsUndefined());
+ return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
+ auto str = state->uncheckedArgument(0).toWTFString(state);
+ RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
impl.anotherFunction(WTFMove(str));
return JSValue::encode(jsUndefined());
}
// by adding the SkipVTableValidation attribute to the interface IDL definition
RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
#endif
- return createWrapper<JSTestCustomNamedGetter, TestCustomNamedGetter>(globalObject, WTFMove(impl));
+ return createWrapper<TestCustomNamedGetter>(globalObject, WTFMove(impl));
}
JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCustomNamedGetter& impl)