Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp

Issue 2061113002: Remove ExceptionState::throwIfNeeded Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
index fdb37cb0948323c93787ddf01239a7afaf628b65..fd83235ee3f6a58fc8dcdcd3bfeb07ed2858bb0f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -130,8 +130,9 @@ static void stringifierAttributeAttributeSetter(v8::Local<v8::Value> v8Value, co
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setStringifierAttribute(cppValue);
}
@@ -227,8 +228,9 @@ static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setStringAttribute(cppValue);
}
@@ -256,8 +258,9 @@ static void byteStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con
ExceptionState exceptionState(ExceptionState::SetterContext, "byteStringAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = toByteString(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setByteStringAttribute(cppValue);
}
@@ -285,8 +288,9 @@ static void usvStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, cons
ExceptionState exceptionState(ExceptionState::SetterContext, "usvStringAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = toUSVString(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUsvStringAttribute(cppValue);
}
@@ -314,8 +318,9 @@ static void domTimeStampAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
ExceptionState exceptionState(ExceptionState::SetterContext, "domTimeStampAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
unsigned long long cppValue = toUInt64(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setDomTimeStampAttribute(cppValue);
}
@@ -343,8 +348,9 @@ static void booleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const
ExceptionState exceptionState(ExceptionState::SetterContext, "booleanAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setBooleanAttribute(cppValue);
}
@@ -372,8 +378,9 @@ static void byteAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
ExceptionState exceptionState(ExceptionState::SetterContext, "byteAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt8(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setByteAttribute(cppValue);
}
@@ -401,8 +408,9 @@ static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setDoubleAttribute(cppValue);
}
@@ -430,8 +438,9 @@ static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setFloatAttribute(cppValue);
}
@@ -459,8 +468,9 @@ static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setLongAttribute(cppValue);
}
@@ -488,8 +498,9 @@ static void longLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const
ExceptionState exceptionState(ExceptionState::SetterContext, "longLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
long long cppValue = toInt64(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setLongLongAttribute(cppValue);
}
@@ -517,8 +528,9 @@ static void octetAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
ExceptionState exceptionState(ExceptionState::SetterContext, "octetAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
unsigned cppValue = toUInt8(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setOctetAttribute(cppValue);
}
@@ -546,8 +558,9 @@ static void shortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt16(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setShortAttribute(cppValue);
}
@@ -575,8 +588,9 @@ static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va
ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedDoubleAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnrestrictedDoubleAttribute(cppValue);
}
@@ -604,8 +618,9 @@ static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedFloatAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnrestrictedFloatAttribute(cppValue);
}
@@ -633,8 +648,9 @@ static void unsignedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
unsigned cppValue = toUInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnsignedLongAttribute(cppValue);
}
@@ -662,8 +678,9 @@ static void unsignedLongLongAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedLongLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
unsigned long long cppValue = toUInt64(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnsignedLongLongAttribute(cppValue);
}
@@ -691,8 +708,9 @@ static void unsignedShortAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(ExceptionState::SetterContext, "unsignedShortAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
unsigned cppValue = toUInt16(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnsignedShortAttribute(cppValue);
}
@@ -722,7 +740,6 @@ static void testInterfaceEmptyAttributeAttributeSetter(v8::Local<v8::Value> v8Va
TestInterfaceEmpty* cppValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setTestInterfaceEmptyAttribute(cppValue);
@@ -754,7 +771,6 @@ static void testObjectAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con
TestObject* cppValue = V8TestObject::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestObject'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setTestObjectAttribute(cppValue);
@@ -836,8 +852,9 @@ static void cssAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::
ExceptionState exceptionState(ExceptionState::SetterContext, "cssAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setCSSAttribute(cppValue);
}
@@ -865,8 +882,9 @@ static void imeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::
ExceptionState exceptionState(ExceptionState::SetterContext, "imeAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setIMEAttribute(cppValue);
}
@@ -894,8 +912,9 @@ static void svgAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::
ExceptionState exceptionState(ExceptionState::SetterContext, "svgAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setSVGAttribute(cppValue);
}
@@ -923,8 +942,9 @@ static void xmlAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::
ExceptionState exceptionState(ExceptionState::SetterContext, "xmlAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setXMLAttribute(cppValue);
}
@@ -978,8 +998,9 @@ static void serializedScriptValueAttributeAttributeSetter(v8::Local<v8::Value> v
ExceptionState exceptionState(ExceptionState::SetterContext, "serializedScriptValueAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
RefPtr<SerializedScriptValue> cppValue = SerializedScriptValue::serialize(info.GetIsolate(), v8Value, nullptr, nullptr, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setSerializedScriptValueAttribute(cppValue);
}
@@ -1061,7 +1082,6 @@ static void windowAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
DOMWindow* cppValue = toDOMWindow(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'Window'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setWindowAttribute(cppValue);
@@ -1093,7 +1113,6 @@ static void documentAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const
Document* cppValue = V8Document::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'Document'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setDocumentAttribute(cppValue);
@@ -1125,7 +1144,6 @@ static void documentFragmentAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
DocumentFragment* cppValue = V8DocumentFragment::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'DocumentFragment'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setDocumentFragmentAttribute(cppValue);
@@ -1157,7 +1175,6 @@ static void documentTypeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
DocumentType* cppValue = V8DocumentType::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'DocumentType'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setDocumentTypeAttribute(cppValue);
@@ -1189,7 +1206,6 @@ static void elementAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const
Element* cppValue = V8Element::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'Element'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setElementAttribute(cppValue);
@@ -1221,7 +1237,6 @@ static void nodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'Node'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setNodeAttribute(cppValue);
@@ -1253,7 +1268,6 @@ static void shadowRootAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con
ShadowRoot* cppValue = V8ShadowRoot::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'ShadowRoot'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setShadowRootAttribute(cppValue);
@@ -1285,7 +1299,6 @@ static void arrayBufferAttributeAttributeSetter(v8::Local<v8::Value> v8Value, co
TestArrayBuffer* cppValue = v8Value->IsArrayBuffer() ? V8ArrayBuffer::toImpl(v8::Local<v8::ArrayBuffer>::Cast(v8Value)) : 0;
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'ArrayBuffer'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setArrayBufferAttribute(cppValue);
@@ -1317,7 +1330,6 @@ static void float32ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
DOMFloat32Array* cppValue = v8Value->IsFloat32Array() ? V8Float32Array::toImpl(v8::Local<v8::Float32Array>::Cast(v8Value)) : 0;
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'Float32Array'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setFloat32ArrayAttribute(cppValue);
@@ -1349,7 +1361,6 @@ static void uint8ArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con
DOMUint8Array* cppValue = v8Value->IsUint8Array() ? V8Uint8Array::toImpl(v8::Local<v8::Uint8Array>::Cast(v8Value)) : 0;
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'Uint8Array'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setUint8ArrayAttribute(cppValue);
@@ -1451,8 +1462,9 @@ static void stringArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, co
ExceptionState exceptionState(ExceptionState::SetterContext, "stringArrayAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
Vector<String> cppValue = toImplArray<Vector<String>>(v8Value, 0, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setStringArrayAttribute(cppValue);
}
@@ -1480,8 +1492,9 @@ static void testInterfaceEmptyArrayAttributeAttributeSetter(v8::Local<v8::Value>
ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceEmptyArrayAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
HeapVector<Member<TestInterfaceEmpty>> cppValue = (toMemberNativeArray<TestInterfaceEmpty>(v8Value, 0, info.GetIsolate(), exceptionState));
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setTestInterfaceEmptyArrayAttribute(cppValue);
}
@@ -1509,8 +1522,9 @@ static void floatArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con
ExceptionState exceptionState(ExceptionState::SetterContext, "floatArrayAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
Vector<float> cppValue = toImplArray<Vector<float>>(v8Value, 0, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setFloatArrayAttribute(cppValue);
}
@@ -1538,8 +1552,9 @@ static void stringFrozenArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ExceptionState exceptionState(ExceptionState::SetterContext, "stringFrozenArrayAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
Vector<String> cppValue = toImplArray<Vector<String>>(v8Value, 0, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setStringFrozenArrayAttribute(cppValue);
}
@@ -1567,8 +1582,9 @@ static void testInterfaceEmptyFrozenArrayAttributeAttributeSetter(v8::Local<v8::
ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceEmptyFrozenArrayAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
HeapVector<Member<TestInterfaceEmpty>> cppValue = (toMemberNativeArray<TestInterfaceEmpty>(v8Value, 0, info.GetIsolate(), exceptionState));
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setTestInterfaceEmptyFrozenArrayAttribute(cppValue);
}
@@ -1595,8 +1611,9 @@ static void stringOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<TreatNullAndUndefinedAsNullString> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setStringOrNullAttribute(cppValue);
}
@@ -1630,8 +1647,9 @@ static void longOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con
ExceptionState exceptionState(ExceptionState::SetterContext, "longOrNullAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setLongOrNullAttribute(cppValue);
}
@@ -1661,7 +1679,6 @@ static void testInterfaceOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8V
TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue && !isUndefinedOrNull(v8Value)) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterface'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setTestInterfaceOrNullAttribute(cppValue);
@@ -1691,8 +1708,9 @@ static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const
ExceptionState exceptionState(ExceptionState::SetterContext, "testEnumAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
const char* validValues[] = {
"",
"EnumValue1",
@@ -1730,8 +1748,9 @@ static void testEnumOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(ExceptionState::SetterContext, "testEnumOrNullAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<TreatNullAndUndefinedAsNullString> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
const char* validValues[] = {
"",
"EnumValue1",
@@ -1764,8 +1783,9 @@ static void staticStringAttributeAttributeGetterCallback(const v8::FunctionCallb
static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
TestObject::setStaticStringAttribute(cppValue);
}
@@ -1790,8 +1810,9 @@ static void staticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, con
v8::Local<v8::Object> holder = info.Holder();
ExceptionState exceptionState(ExceptionState::SetterContext, "staticLongAttribute", "TestObject", holder, info.GetIsolate());
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
TestObject::setStaticLongAttribute(cppValue);
}
@@ -1849,8 +1870,9 @@ static void doubleOrStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
TestObject* impl = V8TestObject::toImpl(holder);
DoubleOrString cppValue;
V8DoubleOrString::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setDoubleOrStringAttribute(cppValue);
}
@@ -1881,8 +1903,9 @@ static void doubleOrStringOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8
TestObject* impl = V8TestObject::toImpl(holder);
DoubleOrString cppValue;
V8DoubleOrString::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::Nullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setDoubleOrStringOrNullAttribute(cppValue);
}
@@ -1913,8 +1936,9 @@ static void doubleOrNullStringAttributeAttributeSetter(v8::Local<v8::Value> v8Va
TestObject* impl = V8TestObject::toImpl(holder);
DoubleOrString cppValue;
V8DoubleOrNullOrString::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::Nullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setDoubleOrNullStringAttribute(cppValue);
}
@@ -1945,8 +1969,9 @@ static void stringOrStringSequenceAttributeAttributeSetter(v8::Local<v8::Value>
TestObject* impl = V8TestObject::toImpl(holder);
StringOrStringSequence cppValue;
V8StringOrStringSequence::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setStringOrStringSequenceAttribute(cppValue);
}
@@ -1977,8 +2002,9 @@ static void testEnumOrDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
TestObject* impl = V8TestObject::toImpl(holder);
TestEnumOrDouble cppValue;
V8TestEnumOrDouble::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setTestEnumOrDoubleAttribute(cppValue);
}
@@ -2009,8 +2035,9 @@ static void unrestrictedDoubleOrStringAttributeAttributeSetter(v8::Local<v8::Val
TestObject* impl = V8TestObject::toImpl(holder);
UnrestrictedDoubleOrString cppValue;
V8UnrestrictedDoubleOrString::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnrestrictedDoubleOrStringAttribute(cppValue);
}
@@ -2042,8 +2069,9 @@ static void activityLoggingAccessForAllWorldsLongAttributeAttributeSetter(v8::Lo
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingAccessForAllWorldsLongAttribute(cppValue);
}
@@ -2080,8 +2108,9 @@ static void activityLoggingGetterForAllWorldsLongAttributeAttributeSetter(v8::Lo
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingGetterForAllWorldsLongAttribute(cppValue);
}
@@ -2109,8 +2138,9 @@ static void activityLoggingSetterForAllWorldsLongAttributeAttributeSetter(v8::Lo
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingSetterForAllWorldsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingSetterForAllWorldsLongAttribute(cppValue);
}
@@ -2192,8 +2222,9 @@ static void cachedArrayAttributeAttributeSetter(v8::Local<v8::Value> v8Value, co
ExceptionState exceptionState(ExceptionState::SetterContext, "cachedArrayAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
Vector<String> cppValue = toImplArray<Vector<String>>(v8Value, 0, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setCachedArrayAttribute(cppValue);
V8HiddenValue::deleteHiddenValue(ScriptState::current(info.GetIsolate()), holder, v8AtomicString(info.GetIsolate(), "cachedArrayAttribute")); // Invalidate the cached value.
}
@@ -2232,8 +2263,9 @@ static void cachedStringOrNoneAttributeAttributeSetter(v8::Local<v8::Value> v8Va
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<TreatNullAndUndefinedAsNullString> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setCachedStringOrNoneAttribute(cppValue);
V8HiddenValue::deleteHiddenValue(ScriptState::current(info.GetIsolate()), holder, v8AtomicString(info.GetIsolate(), "cachedStringOrNoneAttribute")); // Invalidate the cached value.
}
@@ -2337,7 +2369,6 @@ static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(const v
ExceptionState exceptionState(ExceptionState::GetterContext, "checkSecurityForNodeReadonlyDocumentAttribute", "TestObject", holder, info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), currentDOMWindow(info.GetIsolate()), WTF::getPtr(impl->checkSecurityForNodeReadonlyDocumentAttribute()), exceptionState)) {
v8SetReturnValueNull(info);
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValueFast(info, WTF::getPtr(impl->checkSecurityForNodeReadonlyDocumentAttribute()), impl);
@@ -2382,8 +2413,9 @@ static void customGetterLongAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
ExceptionState exceptionState(ExceptionState::SetterContext, "customGetterLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setCustomGetterLongAttribute(cppValue);
}
@@ -2447,8 +2479,9 @@ static void deprecatedLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(ExceptionState::SetterContext, "deprecatedLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setDeprecatedLongAttribute(cppValue);
}
@@ -2477,8 +2510,9 @@ static void enforceRangeLongAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
ExceptionState exceptionState(ExceptionState::SetterContext, "enforceRangeLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, EnforceRange, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setEnforceRangeLongAttribute(cppValue);
}
@@ -2506,8 +2540,9 @@ static void implementedAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ExceptionState exceptionState(ExceptionState::SetterContext, "implementedAsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setImplementedAsName(cppValue);
}
@@ -2539,8 +2574,9 @@ static void customGetterImplementedAsLongAttributeAttributeSetter(v8::Local<v8::
ExceptionState exceptionState(ExceptionState::SetterContext, "customGetterImplementedAsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setImplementedAsNameWithCustomGetter(cppValue);
}
@@ -2587,8 +2623,9 @@ static void measureAsLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(ExceptionState::SetterContext, "measureAsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setMeasureAsLongAttribute(cppValue);
}
@@ -2617,8 +2654,9 @@ static void notEnumerableLongAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ExceptionState exceptionState(ExceptionState::SetterContext, "notEnumerableLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setNotEnumerableLongAttribute(cppValue);
}
@@ -2646,8 +2684,9 @@ static void originTrialEnabledLongAttributeAttributeSetter(v8::Local<v8::Value>
ExceptionState exceptionState(ExceptionState::SetterContext, "originTrialEnabledLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setOriginTrialEnabledLongAttribute(cppValue);
}
@@ -2717,8 +2756,9 @@ static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetter(v8
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingAccessPerWorldBindingsLongAttribute(cppValue);
}
@@ -2755,8 +2795,9 @@ static void activityLoggingAccessPerWorldBindingsLongAttributeAttributeSetterFor
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingAccessPerWorldBindingsLongAttribute(cppValue);
}
@@ -2793,8 +2834,9 @@ static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeA
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue);
}
@@ -2827,8 +2869,9 @@ static void activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttributeA
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingAccessForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue);
}
@@ -2860,8 +2903,9 @@ static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetter(v8
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingGetterPerWorldBindingsLongAttribute(cppValue);
}
@@ -2893,8 +2937,9 @@ static void activityLoggingGetterPerWorldBindingsLongAttributeAttributeSetterFor
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingGetterPerWorldBindingsLongAttribute(cppValue);
}
@@ -2926,8 +2971,9 @@ static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeA
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue);
}
@@ -2955,8 +3001,9 @@ static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeA
ExceptionState exceptionState(ExceptionState::SetterContext, "activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setActivityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttribute(cppValue);
}
@@ -2986,8 +3033,9 @@ static void locationAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Func
if (!impl)
return;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setHref(cppValue);
}
@@ -3018,10 +3066,10 @@ static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> v8Value, c
if (!impl)
return;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setHrefThrows(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
}
static void locationWithExceptionAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -3050,8 +3098,9 @@ static void locationWithCallWithAttributeSetter(v8::Local<v8::Value> v8Value, co
if (!impl)
return;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
impl->setHrefCallWith(executionContext, currentDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue);
}
@@ -3083,8 +3132,9 @@ static void locationByteStringAttributeSetter(v8::Local<v8::Value> v8Value, cons
if (!impl)
return;
V8StringResource<> cppValue = toByteString(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setHrefByteString(cppValue);
}
@@ -3114,8 +3164,9 @@ static void locationWithPerWorldBindingsAttributeSetter(v8::Local<v8::Value> v8V
if (!impl)
return;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setHref(cppValue);
}
@@ -3145,8 +3196,9 @@ static void locationWithPerWorldBindingsAttributeSetterForMainWorld(v8::Local<v8
if (!impl)
return;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setHref(cppValue);
}
@@ -3176,8 +3228,9 @@ static void locationLegacyInterfaceTypeCheckingAttributeSetter(v8::Local<v8::Val
if (!impl)
return;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setHref(cppValue);
}
@@ -3217,7 +3270,6 @@ static void locationGarbageCollectedAttributeSetter(v8::Local<v8::Value> v8Value
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceGarbageCollected'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setAttr1(cppValue);
@@ -3235,7 +3287,7 @@ static void raisesExceptionLongAttributeAttributeGetter(const v8::FunctionCallba
TestObject* impl = V8TestObject::toImpl(holder);
ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate());
int cppValue(impl->raisesExceptionLongAttribute(exceptionState));
- if (UNLIKELY(exceptionState.throwIfNeeded()))
+ if (UNLIKELY(exceptionState.hadException()))
return;
v8SetReturnValueInt(info, cppValue);
}
@@ -3251,10 +3303,10 @@ static void raisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> v8V
ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setRaisesExceptionLongAttribute(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
}
static void raisesExceptionLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -3269,7 +3321,7 @@ static void raisesExceptionGetterLongAttributeAttributeGetter(const v8::Function
TestObject* impl = V8TestObject::toImpl(holder);
ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionGetterLongAttribute", "TestObject", holder, info.GetIsolate());
int cppValue(impl->raisesExceptionGetterLongAttribute(exceptionState));
- if (UNLIKELY(exceptionState.throwIfNeeded()))
+ if (UNLIKELY(exceptionState.hadException()))
return;
v8SetReturnValueInt(info, cppValue);
}
@@ -3285,8 +3337,9 @@ static void raisesExceptionGetterLongAttributeAttributeSetter(v8::Local<v8::Valu
ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptionGetterLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setRaisesExceptionGetterLongAttribute(cppValue);
}
@@ -3314,10 +3367,10 @@ static void setterRaisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Valu
ExceptionState exceptionState(ExceptionState::SetterContext, "setterRaisesExceptionLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setSetterRaisesExceptionLongAttribute(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
}
static void setterRaisesExceptionLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -3332,7 +3385,7 @@ static void raisesExceptionTestInterfaceEmptyAttributeAttributeGetter(const v8::
TestObject* impl = V8TestObject::toImpl(holder);
ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptionTestInterfaceEmptyAttribute", "TestObject", holder, info.GetIsolate());
TestInterfaceEmpty* cppValue(impl->raisesExceptionTestInterfaceEmptyAttribute(exceptionState));
- if (UNLIKELY(exceptionState.throwIfNeeded()))
+ if (UNLIKELY(exceptionState.hadException()))
return;
v8SetReturnValueFast(info, cppValue, impl);
}
@@ -3350,11 +3403,9 @@ static void raisesExceptionTestInterfaceEmptyAttributeAttributeSetter(v8::Local<
TestInterfaceEmpty* cppValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setRaisesExceptionTestInterfaceEmptyAttribute(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
}
static void raisesExceptionTestInterfaceEmptyAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -3377,7 +3428,7 @@ static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeGetter(cons
}
ExceptionState exceptionState(ExceptionState::GetterContext, "cachedAttributeRaisesExceptionGetterAnyAttribute", "TestObject", holder, info.GetIsolate());
ScriptValue cppValue(impl->cachedAttributeRaisesExceptionGetterAnyAttribute(exceptionState));
- if (UNLIKELY(exceptionState.throwIfNeeded()))
+ if (UNLIKELY(exceptionState.hadException()))
return;
v8::Local<v8::Value> v8Value(cppValue.v8Value());
V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName, v8Value);
@@ -3396,7 +3447,6 @@ static void cachedAttributeRaisesExceptionGetterAnyAttributeAttributeSetter(v8::
TestObject* impl = V8TestObject::toImpl(holder);
ScriptValue cppValue = ScriptValue(ScriptState::current(info.GetIsolate()), v8Value);
impl->setCachedAttributeRaisesExceptionGetterAnyAttribute(cppValue, exceptionState);
- exceptionState.throwIfNeeded();
V8HiddenValue::deleteHiddenValue(ScriptState::current(info.GetIsolate()), holder, v8AtomicString(info.GetIsolate(), "cachedAttributeRaisesExceptionGetterAnyAttribute")); // Invalidate the cached value.
}
@@ -3426,7 +3476,6 @@ static void reflectTestInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8
TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterface'.");
- exceptionState.throwIfNeeded();
return;
}
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
@@ -3460,7 +3509,6 @@ static void reflectReflectedNameAttributeTestAttributeAttributeSetter(v8::Local<
TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterface'.");
- exceptionState.throwIfNeeded();
return;
}
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
@@ -3492,8 +3540,9 @@ static void reflectBooleanAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
ExceptionState exceptionState(ExceptionState::SetterContext, "reflectBooleanAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
bool cppValue = toBoolean(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setBooleanAttribute(HTMLNames::reflectbooleanattributeAttr, cppValue);
}
@@ -3523,8 +3572,9 @@ static void reflectLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, co
ExceptionState exceptionState(ExceptionState::SetterContext, "reflectLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setIntegralAttribute(HTMLNames::reflectlongattributeAttr, cppValue);
}
@@ -3554,8 +3604,9 @@ static void reflectUnsignedShortAttributeAttributeSetter(v8::Local<v8::Value> v8
ExceptionState exceptionState(ExceptionState::SetterContext, "reflectUnsignedShortAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
unsigned cppValue = toUInt16(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::reflectunsignedshortattributeAttr, cppValue);
}
@@ -3585,8 +3636,9 @@ static void reflectUnsignedLongAttributeAttributeSetter(v8::Local<v8::Value> v8V
ExceptionState exceptionState(ExceptionState::SetterContext, "reflectUnsignedLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
unsigned cppValue = toUInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setUnsignedIntegralAttribute(HTMLNames::reflectunsignedlongattributeAttr, cppValue);
}
@@ -3615,8 +3667,9 @@ static void idAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCa
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::idAttr, cppValue);
}
@@ -3645,8 +3698,9 @@ static void nameAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Function
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::nameAttr, cppValue);
}
@@ -3675,8 +3729,9 @@ static void classAttributeSetter(v8::Local<v8::Value> v8Value, const v8::Functio
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::classAttr, cppValue);
}
@@ -3705,8 +3760,9 @@ static void reflectedIdAttributeSetter(v8::Local<v8::Value> v8Value, const v8::F
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::idAttr, cppValue);
}
@@ -3735,8 +3791,9 @@ static void reflectedNameAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::nameAttr, cppValue);
}
@@ -3765,8 +3822,9 @@ static void reflectedClassAttributeSetter(v8::Local<v8::Value> v8Value, const v8
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::classAttr, cppValue);
}
@@ -3803,8 +3861,9 @@ static void limitedToOnlyOneAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::limitedtoonlyoneattributeAttr, cppValue);
}
@@ -3845,8 +3904,9 @@ static void limitedToOnlyAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::limitedtoonlyattributeAttr, cppValue);
}
@@ -3885,8 +3945,9 @@ static void limitedToOnlyOtherAttributeAttributeSetter(v8::Local<v8::Value> v8Va
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::otherAttr, cppValue);
}
@@ -3925,8 +3986,9 @@ static void limitedWithMissingDefaultAttributeAttributeSetter(v8::Local<v8::Valu
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::limitedwithmissingdefaultattributeAttr, cppValue);
}
@@ -3967,8 +4029,9 @@ static void limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8::Local<v
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::limitedwithinvalidmissingdefaultattributeAttr, cppValue);
}
@@ -4076,8 +4139,9 @@ static void locationPutForwardsAttributeSetter(v8::Local<v8::Value> v8Value, con
if (!impl)
return;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setHref(cppValue);
}
@@ -4105,8 +4169,9 @@ static void runtimeEnabledLongAttributeAttributeSetter(v8::Local<v8::Value> v8Va
ExceptionState exceptionState(ExceptionState::SetterContext, "runtimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setRuntimeEnabledLongAttribute(cppValue);
}
@@ -4133,8 +4198,9 @@ static void setterCallWithCurrentWindowAndEnteredWindowStringAttributeAttributeS
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setSetterCallWithCurrentWindowAndEnteredWindowStringAttribute(currentDOMWindow(info.GetIsolate()), enteredDOMWindow(info.GetIsolate()), cppValue);
}
@@ -4161,8 +4227,9 @@ static void setterCallWithExecutionContextStringAttributeAttributeSetter(v8::Loc
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
impl->setSetterCallWithExecutionContextStringAttribute(executionContext, cppValue);
}
@@ -4190,8 +4257,9 @@ static void treatNullAsEmptyStringStringAttributeAttributeSetter(v8::Local<v8::V
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<TreatNullAsEmptyString> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setTreatNullAsEmptyStringStringAttribute(cppValue);
}
@@ -4218,8 +4286,9 @@ static void treatNullAsNullStringStringAttributeAttributeSetter(v8::Local<v8::Va
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<TreatNullAsNullString> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setTreatNullAsNullStringStringAttribute(cppValue);
}
@@ -4247,8 +4316,9 @@ static void legacyInterfaceTypeCheckingFloatAttributeAttributeSetter(v8::Local<v
ExceptionState exceptionState(ExceptionState::SetterContext, "legacyInterfaceTypeCheckingFloatAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setLegacyInterfaceTypeCheckingFloatAttribute(cppValue);
}
@@ -4327,8 +4397,9 @@ static void urlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, cons
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::urlstringattributeAttr, cppValue);
}
@@ -4357,8 +4428,9 @@ static void urlStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, cons
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
impl->setAttribute(HTMLNames::reflectUrlAttributeAttr, cppValue);
}
@@ -4388,8 +4460,9 @@ static void unforgeableLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value
ExceptionState exceptionState(ExceptionState::SetterContext, "unforgeableLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnforgeableLongAttribute(cppValue);
}
@@ -4418,8 +4491,9 @@ static void measuredLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
ExceptionState exceptionState(ExceptionState::SetterContext, "measuredLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setMeasuredLongAttribute(cppValue);
}
@@ -4500,8 +4574,9 @@ static void unscopeableLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value
ExceptionState exceptionState(ExceptionState::SetterContext, "unscopeableLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnscopeableLongAttribute(cppValue);
}
@@ -4529,8 +4604,9 @@ static void unscopeableOriginTrialEnabledLongAttributeAttributeSetter(v8::Local<
ExceptionState exceptionState(ExceptionState::SetterContext, "unscopeableOriginTrialEnabledLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnscopeableOriginTrialEnabledLongAttribute(cppValue);
}
@@ -4558,8 +4634,9 @@ static void unscopeableRuntimeEnabledLongAttributeAttributeSetter(v8::Local<v8::
ExceptionState exceptionState(ExceptionState::SetterContext, "unscopeableRuntimeEnabledLongAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
impl->setUnscopeableRuntimeEnabledLongAttribute(cppValue);
}
@@ -4589,7 +4666,6 @@ static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterface'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setTestInterfaceAttribute(cppValue);
@@ -4621,7 +4697,6 @@ static void testInterfaceGarbageCollectedAttributeAttributeSetter(v8::Local<v8::
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceGarbageCollected'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setTestInterfaceGarbageCollectedAttribute(cppValue);
@@ -4653,7 +4728,6 @@ static void testInterfaceGarbageCollectedOrNullAttributeAttributeSetter(v8::Loca
TestInterfaceGarbageCollected* cppValue = V8TestInterfaceGarbageCollected::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue && !isUndefinedOrNull(v8Value)) {
exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceGarbageCollected'.");
- exceptionState.throwIfNeeded();
return;
}
impl->setTestInterfaceGarbageCollectedOrNullAttribute(cppValue);
@@ -4701,8 +4775,9 @@ static void shortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8
ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
int cppValue = toInt16(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
V8TestObject::PrivateScript::shortAttributeAttributeSetter(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, cppValue);
}
@@ -4732,8 +4807,9 @@ static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
V8TestObject::PrivateScript::stringAttributeAttributeSetter(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, cppValue);
}
@@ -4766,7 +4842,6 @@ static void nodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8:
Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value);
if (!cppValue) {
exceptionState.throwTypeError("The provided value is not of type 'Node'.");
- exceptionState.throwIfNeeded();
return;
}
V8TestObject::PrivateScript::nodeAttributeAttributeSetter(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, cppValue);
@@ -4795,8 +4870,9 @@ static void attributeImplementedInCPPForPrivateScriptOnlyAttributeSetter(v8::Loc
v8::Local<v8::Object> holder = info.Holder();
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
impl->setAttributeImplementedInCPPForPrivateScriptOnly(cppValue);
}
@@ -4827,8 +4903,9 @@ static void enumForPrivateScriptAttributeSetter(v8::Local<v8::Value> v8Value, co
ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivateScript", "TestObject", holder, info.GetIsolate());
TestObject* impl = V8TestObject::toImpl(holder);
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return;
+ }
const char* validValues[] = {
"",
"EnumValue1",
@@ -5096,8 +5173,9 @@ static void voidMethodStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>&
V8StringResource<> stringArg;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->voidMethodStringArg(stringArg);
}
@@ -5112,15 +5190,15 @@ static void voidMethodByteStringArgMethod(const v8::FunctionCallbackInfo<v8::Val
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodByteStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
V8StringResource<> stringArg;
{
stringArg = toByteString(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodByteStringArg(stringArg);
}
@@ -5135,15 +5213,15 @@ static void voidMethodUSVStringArgMethod(const v8::FunctionCallbackInfo<v8::Valu
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUSVStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
V8StringResource<> usvStringArg;
{
usvStringArg = toUSVString(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodUSVStringArg(usvStringArg);
}
@@ -5158,15 +5236,15 @@ static void voidMethodDOMTimeStampArgMethod(const v8::FunctionCallbackInfo<v8::V
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDOMTimeStampArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned long long domTimeStampArg;
{
domTimeStampArg = toUInt64(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDOMTimeStampArg(domTimeStampArg);
}
@@ -5181,15 +5259,15 @@ static void voidMethodBooleanArgMethod(const v8::FunctionCallbackInfo<v8::Value>
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodBooleanArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
bool booleanArg;
{
booleanArg = toBoolean(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodBooleanArg(booleanArg);
}
@@ -5204,15 +5282,15 @@ static void voidMethodByteArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodByteArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int byteArg;
{
byteArg = toInt8(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodByteArg(byteArg);
}
@@ -5227,15 +5305,15 @@ static void voidMethodDoubleArgMethod(const v8::FunctionCallbackInfo<v8::Value>&
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
double doubleArg;
{
doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDoubleArg(doubleArg);
}
@@ -5250,15 +5328,15 @@ static void voidMethodFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>&
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodFloatArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
float floatArg;
{
floatArg = toRestrictedFloat(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodFloatArg(floatArg);
}
@@ -5273,15 +5351,15 @@ static void voidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodLongArg(longArg);
}
@@ -5296,15 +5374,15 @@ static void voidMethodLongLongArgMethod(const v8::FunctionCallbackInfo<v8::Value
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
long long longLongArg;
{
longLongArg = toInt64(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodLongLongArg(longLongArg);
}
@@ -5319,15 +5397,15 @@ static void voidMethodOctetArgMethod(const v8::FunctionCallbackInfo<v8::Value>&
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodOctetArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned octetArg;
{
octetArg = toUInt8(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodOctetArg(octetArg);
}
@@ -5342,15 +5420,15 @@ static void voidMethodShortArgMethod(const v8::FunctionCallbackInfo<v8::Value>&
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodShortArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int shortArg;
{
shortArg = toInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodShortArg(shortArg);
}
@@ -5365,15 +5443,15 @@ static void voidMethodUnsignedLongArgMethod(const v8::FunctionCallbackInfo<v8::V
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned unsignedLongArg;
{
unsignedLongArg = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodUnsignedLongArg(unsignedLongArg);
}
@@ -5388,15 +5466,15 @@ static void voidMethodUnsignedLongLongArgMethod(const v8::FunctionCallbackInfo<v
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedLongLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned long long unsignedLongLongArg;
{
unsignedLongLongArg = toUInt64(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodUnsignedLongLongArg(unsignedLongLongArg);
}
@@ -5411,15 +5489,15 @@ static void voidMethodUnsignedShortArgMethod(const v8::FunctionCallbackInfo<v8::
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned unsignedShortArg;
{
unsignedShortArg = toUInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodUnsignedShortArg(unsignedShortArg);
}
@@ -5468,7 +5546,6 @@ static void voidMethodLongArgTestInterfaceEmptyArgMethod(const v8::FunctionCallb
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
setMinimumArityTypeError(exceptionState, 2, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -5476,12 +5553,12 @@ static void voidMethodLongArgTestInterfaceEmptyArgMethod(const v8::FunctionCallb
TestInterfaceEmpty* testInterfaceEmptyArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]);
if (!testInterfaceEmptyArg) {
exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
}
@@ -6058,15 +6135,15 @@ static void voidMethodArrayLongArgMethod(const v8::FunctionCallbackInfo<v8::Valu
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
Vector<int> arrayLongArg;
{
arrayLongArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodArrayLongArg(arrayLongArg);
}
@@ -6081,15 +6158,15 @@ static void voidMethodArrayStringArgMethod(const v8::FunctionCallbackInfo<v8::Va
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
Vector<String> arrayStringArg;
{
arrayStringArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodArrayStringArg(arrayStringArg);
}
@@ -6104,15 +6181,15 @@ static void voidMethodArrayTestInterfaceEmptyArgMethod(const v8::FunctionCallbac
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
HeapVector<Member<TestInterfaceEmpty>> arrayTestInterfaceEmptyArg;
{
arrayTestInterfaceEmptyArg = (toMemberNativeArray<TestInterfaceEmpty>(info[0], 1, info.GetIsolate(), exceptionState));
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodArrayTestInterfaceEmptyArg(arrayTestInterfaceEmptyArg);
}
@@ -6127,7 +6204,6 @@ static void voidMethodNullableArrayLongArgMethod(const v8::FunctionCallbackInfo<
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodNullableArrayLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -6135,8 +6211,9 @@ static void voidMethodNullableArrayLongArgMethod(const v8::FunctionCallbackInfo<
{
if (!isUndefinedOrNull(info[0])) {
arrayLongArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
}
impl->voidMethodNullableArrayLongArg(arrayLongArg);
@@ -6185,15 +6262,15 @@ static void voidMethodSequenceLongArgMethod(const v8::FunctionCallbackInfo<v8::V
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
Vector<int> longSequenceArg;
{
longSequenceArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodSequenceLongArg(longSequenceArg);
}
@@ -6208,15 +6285,15 @@ static void voidMethodSequenceStringArgMethod(const v8::FunctionCallbackInfo<v8:
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
Vector<String> stringSequenceArg;
{
stringSequenceArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodSequenceStringArg(stringSequenceArg);
}
@@ -6231,15 +6308,15 @@ static void voidMethodSequenceTestInterfaceEmptyArgMethod(const v8::FunctionCall
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
HeapVector<Member<TestInterfaceEmpty>> testInterfaceEmptySequenceArg;
{
testInterfaceEmptySequenceArg = (toMemberNativeArray<TestInterfaceEmpty>(info[0], 1, info.GetIsolate(), exceptionState));
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodSequenceTestInterfaceEmptyArg(testInterfaceEmptySequenceArg);
}
@@ -6254,15 +6331,15 @@ static void voidMethodSequenceSequenceDOMStringArgMethod(const v8::FunctionCallb
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSequenceSequenceDOMStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
Vector<Vector<String>> stringSequenceSequenceArg;
{
stringSequenceSequenceArg = toImplArray<Vector<Vector<String>>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodSequenceSequenceDOMStringArg(stringSequenceSequenceArg);
}
@@ -6277,7 +6354,6 @@ static void voidMethodNullableSequenceLongArgMethod(const v8::FunctionCallbackIn
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodNullableSequenceLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -6285,8 +6361,9 @@ static void voidMethodNullableSequenceLongArgMethod(const v8::FunctionCallbackIn
{
if (!isUndefinedOrNull(info[0])) {
longSequenceArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
}
impl->voidMethodNullableSequenceLongArg(longSequenceArg);
@@ -6313,15 +6390,15 @@ static void voidMethodStringFrozenArrayMethodMethod(const v8::FunctionCallbackIn
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodStringFrozenArrayMethod", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
Vector<String> stringFrozenArrayArg;
{
stringFrozenArrayArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodStringFrozenArrayMethod(stringFrozenArrayArg);
}
@@ -6336,15 +6413,15 @@ static void voidMethodTestInterfaceEmptyFrozenArrayMethodMethod(const v8::Functi
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceEmptyFrozenArrayMethod", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
HeapVector<Member<TestInterfaceEmpty>> testInterfaceEmptyFrozenArrayArg;
{
testInterfaceEmptyFrozenArrayArg = (toMemberNativeArray<TestInterfaceEmpty>(info[0], 1, info.GetIsolate(), exceptionState));
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodTestInterfaceEmptyFrozenArrayMethod(testInterfaceEmptyFrozenArrayArg);
}
@@ -6450,15 +6527,15 @@ static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleOrDOMStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
DoubleOrString arg;
{
V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDoubleOrDOMStringArg(arg);
}
@@ -6473,15 +6550,15 @@ static void voidMethodDoubleOrDOMStringOrNullArgMethod(const v8::FunctionCallbac
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleOrDOMStringOrNullArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
DoubleOrString arg;
{
V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::Nullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDoubleOrDOMStringOrNullArg(arg);
}
@@ -6496,15 +6573,15 @@ static void voidMethodDoubleOrNullOrDOMStringArgMethod(const v8::FunctionCallbac
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleOrNullOrDOMStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
DoubleOrString arg;
{
V8DoubleOrNullOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::Nullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDoubleOrNullOrDOMStringArg(arg);
}
@@ -6519,15 +6596,15 @@ static void voidMethodDOMStringOrArrayBufferOrArrayBufferViewArgMethod(const v8:
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
StringOrArrayBufferOrArrayBufferView arg;
{
V8StringOrArrayBufferOrArrayBufferView::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg(arg);
}
@@ -6542,15 +6619,15 @@ static void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethod(const v8
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
ArrayBufferOrArrayBufferViewOrDictionary arg;
{
V8ArrayBufferOrArrayBufferViewOrDictionary::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg(arg);
}
@@ -6567,8 +6644,9 @@ static void voidMethodArrayOfDoubleOrDOMStringArgMethod(const v8::FunctionCallba
HeapVector<DoubleOrString> arg;
{
arg = toImplArguments<HeapVector<DoubleOrString>>(info, 0, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodArrayOfDoubleOrDOMStringArg(arg);
}
@@ -6686,15 +6764,15 @@ static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestEnumArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
V8StringResource<> testEnumTypeArg;
{
testEnumTypeArg = info[0];
- if (!testEnumTypeArg.prepare())
+ if (!testEnumTypeArg.prepare()) {
return;
+ }
const char* validValues[] = {
"",
"EnumValue1",
@@ -6702,7 +6780,6 @@ static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value
"EnumValue3",
};
if (!isValidEnum(testEnumTypeArg, validValues, WTF_ARRAY_LENGTH(validValues), "TestEnum", exceptionState)) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -6761,8 +6838,9 @@ static void passPermissiveDictionaryMethodMethod(const v8::FunctionCallbackInfo<
TestDictionary arg;
{
V8TestDictionary::toImpl(info.GetIsolate(), info[0], arg, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->passPermissiveDictionaryMethod(arg);
}
@@ -6787,6 +6865,7 @@ static void promiseMethodMethodPromise(const v8::FunctionCallbackInfo<v8::Value>
{
if (UNLIKELY(info.Length() < 3)) {
setMinimumArityTypeError(exceptionState, 3, info.Length());
+ exceptionState.clearException();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -6796,21 +6875,26 @@ static void promiseMethodMethodPromise(const v8::FunctionCallbackInfo<v8::Value>
Vector<String> variadic;
{
arg1 = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.hadException())
+ if (exceptionState.hadException()) {
return;
+ }
if (!isUndefinedOrNull(info[1]) && !info[1]->IsObject()) {
exceptionState.throwTypeError("parameter 2 ('arg2') is not an object.");
+ exceptionState.clearException();
return;
}
arg2 = Dictionary(info[1], info.GetIsolate(), exceptionState);
- if (exceptionState.hadException())
+ if (exceptionState.hadException()) {
return;
+ }
arg3 = info[2];
- if (!arg3.prepare(exceptionState))
+ if (!arg3.prepare(exceptionState)) {
return;
+ }
variadic = toImplArguments<Vector<String>>(info, 3, exceptionState);
- if (exceptionState.hadException())
- return;
+ if (exceptionState.hadException()) {
+ exceptionState.clearException(); return;
+ }
}
v8SetReturnValue(info, impl->promiseMethod(arg1, arg2, arg3, variadic).v8Value());
}
@@ -6832,6 +6916,7 @@ static void promiseMethodWithoutExceptionStateMethodPromise(const v8::FunctionCa
{
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
+ exceptionState.clearException();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -6839,11 +6924,13 @@ static void promiseMethodWithoutExceptionStateMethodPromise(const v8::FunctionCa
{
if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
exceptionState.throwTypeError("parameter 1 ('arg1') is not an object.");
+ exceptionState.clearException();
return;
}
arg1 = Dictionary(info[0], info.GetIsolate(), exceptionState);
- if (exceptionState.hadException())
+ if (exceptionState.hadException()) {
return;
+ }
}
v8SetReturnValue(info, impl->promiseMethodWithoutExceptionState(arg1).v8Value());
}
@@ -6888,7 +6975,6 @@ static void voidMethodDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Val
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDictionaryArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -6896,12 +6982,12 @@ static void voidMethodDictionaryArgMethod(const v8::FunctionCallbackInfo<v8::Val
{
if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
exceptionState.throwTypeError("parameter 1 ('dictionaryArg') is not an object.");
- exceptionState.throwIfNeeded();
return;
}
dictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDictionaryArg(dictionaryArg);
}
@@ -6958,15 +7044,15 @@ static void voidMethodSerializedScriptValueArgMethod(const v8::FunctionCallbackI
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodSerializedScriptValueArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
RefPtr<SerializedScriptValue> serializedScriptValueArg;
{
serializedScriptValueArg = SerializedScriptValue::serialize(info.GetIsolate(), info[0], nullptr, nullptr, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodSerializedScriptValueArg(serializedScriptValueArg);
}
@@ -7004,15 +7090,15 @@ static void voidMethodDictionarySequenceArgMethod(const v8::FunctionCallbackInfo
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDictionarySequenceArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
Vector<Dictionary> dictionarySequenceArg;
{
dictionarySequenceArg = toImplArray<Vector<Dictionary>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDictionarySequenceArg(dictionarySequenceArg);
}
@@ -7027,7 +7113,6 @@ static void voidMethodStringArgLongArgMethod(const v8::FunctionCallbackInfo<v8::
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodStringArgLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
setMinimumArityTypeError(exceptionState, 2, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -7035,11 +7120,13 @@ static void voidMethodStringArgLongArgMethod(const v8::FunctionCallbackInfo<v8::
int longArg;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
longArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodStringArgLongArg(stringArg, longArg);
}
@@ -7065,8 +7152,9 @@ static void voidMethodOptionalStringArgMethod(const v8::FunctionCallbackInfo<v8:
return;
}
optionalStringArg = info[0];
- if (!optionalStringArg.prepare())
+ if (!optionalStringArg.prepare()) {
return;
+ }
}
impl->voidMethodOptionalStringArg(optionalStringArg);
}
@@ -7122,8 +7210,9 @@ static void voidMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::V
return;
}
optionalLongArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodOptionalLongArg(optionalLongArg);
}
@@ -7150,8 +7239,9 @@ static void stringMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8:
return;
}
optionalLongArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
v8SetReturnValueString(info, impl->stringMethodOptionalLongArg(optionalLongArg), info.GetIsolate());
}
@@ -7178,8 +7268,9 @@ static void testInterfaceEmptyMethodOptionalLongArgMethod(const v8::FunctionCall
return;
}
optionalLongArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
v8SetReturnValue(info, impl->testInterfaceEmptyMethodOptionalLongArg(optionalLongArg));
}
@@ -7206,8 +7297,9 @@ static void longMethodOptionalLongArgMethod(const v8::FunctionCallbackInfo<v8::V
return;
}
optionalLongArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
v8SetReturnValueInt(info, impl->longMethodOptionalLongArg(optionalLongArg));
}
@@ -7222,7 +7314,6 @@ static void voidMethodLongArgOptionalLongArgMethod(const v8::FunctionCallbackInf
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -7236,15 +7327,17 @@ static void voidMethodLongArgOptionalLongArgMethod(const v8::FunctionCallbackInf
--numArgsPassed;
}
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
if (UNLIKELY(numArgsPassed <= 1)) {
impl->voidMethodLongArgOptionalLongArg(longArg);
return;
}
optionalLongArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodLongArgOptionalLongArg(longArg, optionalLongArg);
}
@@ -7259,7 +7352,6 @@ static void voidMethodLongArgOptionalLongArgOptionalLongArgMethod(const v8::Func
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalLongArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -7274,22 +7366,25 @@ static void voidMethodLongArgOptionalLongArgOptionalLongArgMethod(const v8::Func
--numArgsPassed;
}
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
if (UNLIKELY(numArgsPassed <= 1)) {
impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg);
return;
}
optionalLongArg1 = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
if (UNLIKELY(numArgsPassed <= 2)) {
impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg, optionalLongArg1);
return;
}
optionalLongArg2 = toInt32(info.GetIsolate(), info[2], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodLongArgOptionalLongArgOptionalLongArg(longArg, optionalLongArg1, optionalLongArg2);
}
@@ -7304,7 +7399,6 @@ static void voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(const v8::Funct
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodLongArgOptionalTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -7318,8 +7412,9 @@ static void voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(const v8::Funct
--numArgsPassed;
}
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
if (UNLIKELY(numArgsPassed <= 1)) {
impl->voidMethodLongArgOptionalTestInterfaceEmptyArg(longArg);
return;
@@ -7327,7 +7422,6 @@ static void voidMethodLongArgOptionalTestInterfaceEmptyArgMethod(const v8::Funct
optionalTestInterfaceEmpty = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]);
if (!optionalTestInterfaceEmpty) {
exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
}
@@ -7344,7 +7438,6 @@ static void voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(const v8::Funct
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceEmptyArgOptionalLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -7360,7 +7453,6 @@ static void voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(const v8::Funct
optionalTestInterfaceEmpty = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]);
if (!optionalTestInterfaceEmpty) {
exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
if (UNLIKELY(numArgsPassed <= 1)) {
@@ -7368,8 +7460,9 @@ static void voidMethodTestInterfaceEmptyArgOptionalLongArgMethod(const v8::Funct
return;
}
longArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodTestInterfaceEmptyArgOptionalLongArg(optionalTestInterfaceEmpty, longArg);
}
@@ -7387,12 +7480,12 @@ static void voidMethodOptionalDictionaryArgMethod(const v8::FunctionCallbackInfo
{
if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
exceptionState.throwTypeError("parameter 1 ('optionalDictionaryArg') is not an object.");
- exceptionState.throwIfNeeded();
return;
}
optionalDictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodOptionalDictionaryArg(optionalDictionaryArg);
}
@@ -7410,8 +7503,9 @@ static void voidMethodDefaultByteStringArgMethod(const v8::FunctionCallbackInfo<
{
if (!info[0]->IsUndefined()) {
defaultByteStringArg = toByteString(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultByteStringArg = String("foo");
}
@@ -7431,8 +7525,9 @@ static void voidMethodDefaultStringArgMethod(const v8::FunctionCallbackInfo<v8::
{
if (!info[0]->IsUndefined()) {
defaultStringArg = info[0];
- if (!defaultStringArg.prepare())
+ if (!defaultStringArg.prepare()) {
return;
+ }
} else {
defaultStringArg = String("foo");
}
@@ -7455,22 +7550,25 @@ static void voidMethodDefaultIntegerArgsMethod(const v8::FunctionCallbackInfo<v8
{
if (!info[0]->IsUndefined()) {
defaultLongArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultLongArg = 10;
}
if (!info[1]->IsUndefined()) {
defaultLongLongArg = toInt64(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultLongLongArg = -10;
}
if (!info[2]->IsUndefined()) {
defaultUnsignedArg = toUInt32(info.GetIsolate(), info[2], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultUnsignedArg = 4294967295u;
}
@@ -7491,8 +7589,9 @@ static void voidMethodDefaultDoubleArgMethod(const v8::FunctionCallbackInfo<v8::
{
if (!info[0]->IsUndefined()) {
defaultDoubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultDoubleArg = 0.5;
}
@@ -7513,8 +7612,9 @@ static void voidMethodDefaultTrueBooleanArgMethod(const v8::FunctionCallbackInfo
{
if (!info[0]->IsUndefined()) {
defaultBooleanArg = toBoolean(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultBooleanArg = true;
}
@@ -7535,8 +7635,9 @@ static void voidMethodDefaultFalseBooleanArgMethod(const v8::FunctionCallbackInf
{
if (!info[0]->IsUndefined()) {
defaultBooleanArg = toBoolean(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultBooleanArg = false;
}
@@ -7557,8 +7658,9 @@ static void voidMethodDefaultNullableByteStringArgMethod(const v8::FunctionCallb
{
if (!info[0]->IsUndefined()) {
defaultStringArg = toByteString(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultStringArg = nullptr;
}
@@ -7578,8 +7680,9 @@ static void voidMethodDefaultNullableStringArgMethod(const v8::FunctionCallbackI
{
if (!info[0]->IsUndefined()) {
defaultStringArg = info[0];
- if (!defaultStringArg.prepare())
+ if (!defaultStringArg.prepare()) {
return;
+ }
} else {
defaultStringArg = nullptr;
}
@@ -7625,22 +7728,25 @@ static void voidMethodDefaultDoubleOrStringArgsMethod(const v8::FunctionCallback
{
if (!info[0]->IsUndefined()) {
V8DoubleOrString::toImpl(info.GetIsolate(), info[0], defaultLongArg, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultLongArg.setDouble(10);
}
if (!info[1]->IsUndefined()) {
V8DoubleOrStringOrNull::toImpl(info.GetIsolate(), info[1], defaultStringArg, UnionTypeConversionMode::Nullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
defaultStringArg.setString(String("foo"));
}
if (!info[2]->IsUndefined()) {
V8DoubleOrString::toImpl(info.GetIsolate(), info[2], defaultNullArg, UnionTypeConversionMode::Nullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
/* null default value */;
}
@@ -7661,8 +7767,9 @@ static void voidMethodDefaultStringSequenceArgMethod(const v8::FunctionCallbackI
{
if (!info[0]->IsUndefined()) {
defaultStringSequenceArg = toImplArray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
} else {
/* Nothing to do */;
}
@@ -7682,8 +7789,9 @@ static void voidMethodVariadicStringArgMethod(const v8::FunctionCallbackInfo<v8:
Vector<String> variadicStringArgs;
{
variadicStringArgs = toImplArguments<Vector<String>>(info, 0, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodVariadicStringArg(variadicStringArgs);
}
@@ -7698,7 +7806,6 @@ static void voidMethodStringArgVariadicStringArgMethod(const v8::FunctionCallbac
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodStringArgVariadicStringArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -7706,11 +7813,13 @@ static void voidMethodStringArgVariadicStringArgMethod(const v8::FunctionCallbac
Vector<String> variadicStringArgs;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
variadicStringArgs = toImplArguments<Vector<String>>(info, 1, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodStringArgVariadicStringArg(stringArg, variadicStringArgs);
}
@@ -7729,7 +7838,6 @@ static void voidMethodVariadicTestInterfaceEmptyArgMethod(const v8::FunctionCall
for (int i = 0; i < info.Length(); ++i) {
if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) {
exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
variadicTestInterfaceEmptyArgs.append(V8TestInterfaceEmpty::toImpl(v8::Local<v8::Object>::Cast(info[i])));
@@ -7748,7 +7856,6 @@ static void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethod(c
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -7758,13 +7865,11 @@ static void voidMethodTestInterfaceEmptyArgVariadicTestInterfaceEmptyArgMethod(c
testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]);
if (!testInterfaceEmptyArg) {
exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
for (int i = 1; i < info.Length(); ++i) {
if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) {
exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
variadicTestInterfaceEmptyArgs.append(V8TestInterfaceEmpty::toImpl(v8::Local<v8::Object>::Cast(info[i])));
@@ -7787,7 +7892,6 @@ static void voidMethodVariadicTestInterfaceGarbageCollectedArgMethod(const v8::F
for (int i = 0; i < info.Length(); ++i) {
if (!V8TestInterfaceGarbageCollected::hasInstance(info[i], info.GetIsolate())) {
exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceGarbageCollected'.");
- exceptionState.throwIfNeeded();
return;
}
variadicTestInterfaceGarbageCollectedArg.append(V8TestInterfaceGarbageCollected::toImpl(v8::Local<v8::Object>::Cast(info[i])));
@@ -7808,8 +7912,9 @@ static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodA(longArg);
}
@@ -7822,11 +7927,13 @@ static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
int longArg2;
{
longArg1 = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
longArg2 = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodA(longArg1, longArg2);
}
@@ -7852,11 +7959,9 @@ static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -7872,8 +7977,9 @@ static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>&
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodB(longArg);
}
@@ -7892,15 +7998,17 @@ static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>&
--numArgsPassed;
}
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
if (UNLIKELY(numArgsPassed <= 1)) {
impl->overloadedMethodB(stringArg);
return;
}
longArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodB(stringArg, longArg);
}
@@ -7934,11 +8042,9 @@ static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -7954,8 +8060,9 @@ static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>&
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodC(longArg);
}
@@ -7993,11 +8100,9 @@ static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8013,8 +8118,9 @@ static void overloadedMethodD1Method(const v8::FunctionCallbackInfo<v8::Value>&
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodD(longArg);
}
@@ -8026,8 +8132,9 @@ static void overloadedMethodD2Method(const v8::FunctionCallbackInfo<v8::Value>&
Vector<int> longArrayArg;
{
longArrayArg = toImplArray<Vector<int>>(info[0], 1, info.GetIsolate(), exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodD(longArrayArg);
}
@@ -8051,11 +8158,9 @@ static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8071,8 +8176,9 @@ static void overloadedMethodE1Method(const v8::FunctionCallbackInfo<v8::Value>&
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodE(longArg);
}
@@ -8114,11 +8220,9 @@ static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8143,8 +8247,9 @@ static void overloadedMethodF1Method(const v8::FunctionCallbackInfo<v8::Value>&
return;
}
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->overloadedMethodF(stringArg);
}
@@ -8156,8 +8261,9 @@ static void overloadedMethodF2Method(const v8::FunctionCallbackInfo<v8::Value>&
double doubleArg;
{
doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodF(doubleArg);
}
@@ -8194,7 +8300,6 @@ static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& i
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8210,8 +8315,9 @@ static void overloadedMethodG1Method(const v8::FunctionCallbackInfo<v8::Value>&
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodG(longArg);
}
@@ -8266,7 +8372,6 @@ static void overloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& i
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8322,11 +8427,9 @@ static void overloadedMethodHMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8341,8 +8444,9 @@ static void overloadedMethodI1Method(const v8::FunctionCallbackInfo<v8::Value>&
V8StringResource<> stringArg;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->overloadedMethodI(stringArg);
}
@@ -8354,8 +8458,9 @@ static void overloadedMethodI2Method(const v8::FunctionCallbackInfo<v8::Value>&
double doubleArg;
{
doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodI(doubleArg);
}
@@ -8383,11 +8488,9 @@ static void overloadedMethodIMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8402,8 +8505,9 @@ static void overloadedMethodJ1Method(const v8::FunctionCallbackInfo<v8::Value>&
V8StringResource<> stringArg;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->overloadedMethodJ(stringArg);
}
@@ -8416,12 +8520,12 @@ static void overloadedMethodJ2Method(const v8::FunctionCallbackInfo<v8::Value>&
{
if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
exceptionState.throwTypeError("parameter 1 ('testDictionaryArg') is not an object.");
- exceptionState.throwIfNeeded();
return;
}
V8TestDictionary::toImpl(info.GetIsolate(), info[0], testDictionaryArg, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodJ(testDictionaryArg);
}
@@ -8445,11 +8549,9 @@ static void overloadedMethodJMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8478,8 +8580,9 @@ static void overloadedMethodK2Method(const v8::FunctionCallbackInfo<v8::Value>&
V8StringResource<> stringArg;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->overloadedMethodK(stringArg);
}
@@ -8503,11 +8606,9 @@ static void overloadedMethodKMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8524,11 +8625,13 @@ static void overloadedMethodL1Method(const v8::FunctionCallbackInfo<v8::Value>&
Vector<ScriptValue> restArgs;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
restArgs = toImplArguments<Vector<ScriptValue>>(info, 1, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodL(longArg, restArgs);
}
@@ -8541,11 +8644,13 @@ static void overloadedMethodL2Method(const v8::FunctionCallbackInfo<v8::Value>&
Vector<ScriptValue> restArgs;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
restArgs = toImplArguments<Vector<ScriptValue>>(info, 1, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedMethodL(stringArg, restArgs);
}
@@ -8587,11 +8692,9 @@ static void overloadedMethodLMethod(const v8::FunctionCallbackInfo<v8::Value>& i
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8615,11 +8718,13 @@ static void promiseOverloadMethod2MethodPromise(const v8::FunctionCallbackInfo<v
arg1 = toDOMWindow(info.GetIsolate(), info[0]);
if (!arg1) {
exceptionState.throwTypeError("parameter 1 is not of type 'Window'.");
+ exceptionState.clearException();
return;
}
arg2 = toRestrictedDouble(info.GetIsolate(), info[1], exceptionState);
- if (exceptionState.hadException())
+ if (exceptionState.hadException()) {
return;
+ }
}
v8SetReturnValue(info, impl->promiseOverloadMethod(arg1, arg2).v8Value());
}
@@ -8641,11 +8746,13 @@ static void promiseOverloadMethod3MethodPromise(const v8::FunctionCallbackInfo<v
arg1 = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]);
if (!arg1) {
exceptionState.throwTypeError("parameter 1 is not of type 'Document'.");
+ exceptionState.clearException();
return;
}
arg2 = toRestrictedDouble(info.GetIsolate(), info[1], exceptionState);
- if (exceptionState.hadException())
+ if (exceptionState.hadException()) {
return;
+ }
}
v8SetReturnValue(info, impl->promiseOverloadMethod(arg1, arg2).v8Value());
}
@@ -8682,12 +8789,14 @@ static void promiseOverloadMethodMethod(const v8::FunctionCallbackInfo<v8::Value
if (info.Length() >= 0) {
setArityTypeError(exceptionState, "[0, 2]", info.Length());
v8SetReturnValue(info, exceptionState.reject(ScriptState::current(info.GetIsolate())).v8Value());
+ exceptionState.clearException();
return;
}
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
v8SetReturnValue(info, exceptionState.reject(ScriptState::current(info.GetIsolate())).v8Value());
+ exceptionState.clearException();
return;
}
@@ -8715,8 +8824,9 @@ static void overloadedPerWorldBindingsMethod2Method(const v8::FunctionCallbackIn
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedPerWorldBindingsMethod(longArg);
}
@@ -8741,7 +8851,6 @@ static void overloadedPerWorldBindingsMethodMethod(const v8::FunctionCallbackInf
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8757,8 +8866,9 @@ static void overloadedPerWorldBindingsMethod2MethodForMainWorld(const v8::Functi
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->overloadedPerWorldBindingsMethod(longArg);
}
@@ -8783,7 +8893,6 @@ static void overloadedPerWorldBindingsMethodMethodForMainWorld(const v8::Functio
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8798,8 +8907,9 @@ static void overloadedStaticMethod1Method(const v8::FunctionCallbackInfo<v8::Val
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
TestObject::overloadedStaticMethod(longArg);
}
@@ -8811,11 +8921,13 @@ static void overloadedStaticMethod2Method(const v8::FunctionCallbackInfo<v8::Val
int longArg2;
{
longArg1 = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
longArg2 = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
TestObject::overloadedStaticMethod(longArg1, longArg2);
}
@@ -8841,11 +8953,9 @@ static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -8859,15 +8969,15 @@ static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned index;
{
index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
ScriptValue result = impl->item(scriptState, index);
@@ -8884,7 +8994,6 @@ static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
setMinimumArityTypeError(exceptionState, 2, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -8892,11 +9001,13 @@ static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
V8StringResource<> value;
{
index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
value = info[1];
- if (!value.prepare())
+ if (!value.prepare()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
String result = impl->setItem(scriptState, index, value);
@@ -8913,15 +9024,15 @@ static void voidMethodClampUnsignedShortArgMethod(const v8::FunctionCallbackInfo
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodClampUnsignedShortArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned clampUnsignedShortArg;
{
clampUnsignedShortArg = toUInt16(info.GetIsolate(), info[0], Clamp, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodClampUnsignedShortArg(clampUnsignedShortArg);
}
@@ -8936,15 +9047,15 @@ static void voidMethodClampUnsignedLongArgMethod(const v8::FunctionCallbackInfo<
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodClampUnsignedLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
unsigned clampUnsignedLongArg;
{
clampUnsignedLongArg = toUInt32(info.GetIsolate(), info[0], Clamp, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodClampUnsignedLongArg(clampUnsignedLongArg);
}
@@ -8980,8 +9091,9 @@ static void voidMethodDefaultUndefinedLongArgMethod(const v8::FunctionCallbackIn
int defaultUndefinedLongArg;
{
defaultUndefinedLongArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodDefaultUndefinedLongArg(defaultUndefinedLongArg);
}
@@ -8997,8 +9109,9 @@ static void voidMethodDefaultUndefinedStringArgMethod(const v8::FunctionCallback
V8StringResource<> defaultUndefinedStringArg;
{
defaultUndefinedStringArg = info[0];
- if (!defaultUndefinedStringArg.prepare())
+ if (!defaultUndefinedStringArg.prepare()) {
return;
+ }
}
impl->voidMethodDefaultUndefinedStringArg(defaultUndefinedStringArg);
}
@@ -9013,15 +9126,15 @@ static void voidMethodEnforceRangeLongArgMethod(const v8::FunctionCallbackInfo<v
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodEnforceRangeLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int enforceRangeLongArg;
{
enforceRangeLongArg = toInt32(info.GetIsolate(), info[0], EnforceRange, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodEnforceRangeLongArg(enforceRangeLongArg);
}
@@ -9041,8 +9154,9 @@ static void voidMethodTreatNullAsEmptyStringStringArgMethod(const v8::FunctionCa
V8StringResource<TreatNullAsEmptyString> treatNullAsEmptyStringStringArg;
{
treatNullAsEmptyStringStringArg = info[0];
- if (!treatNullAsEmptyStringStringArg.prepare())
+ if (!treatNullAsEmptyStringStringArg.prepare()) {
return;
+ }
}
impl->voidMethodTreatNullAsEmptyStringStringArg(treatNullAsEmptyStringStringArg);
}
@@ -9062,8 +9176,9 @@ static void voidMethodTreatNullAsNullStringStringArgMethod(const v8::FunctionCal
V8StringResource<TreatNullAsNullString> treatNullAsNullStringStringArg;
{
treatNullAsNullStringStringArg = info[0];
- if (!treatNullAsNullStringStringArg.prepare())
+ if (!treatNullAsNullStringStringArg.prepare()) {
return;
+ }
}
impl->voidMethodTreatNullAsNullStringStringArg(treatNullAsNullStringStringArg);
}
@@ -9083,8 +9198,9 @@ static void voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArgMe
V8StringResource<TreatNullAndUndefinedAsNullString> treatNullAsNullStringStringArg;
{
treatNullAsNullStringStringArg = info[0];
- if (!treatNullAsNullStringStringArg.prepare())
+ if (!treatNullAsNullStringStringArg.prepare()) {
return;
+ }
}
impl->voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg(treatNullAsNullStringStringArg);
}
@@ -9194,8 +9310,9 @@ static void callWithScriptStateScriptArgumentsVoidMethodOptionalBooleanArgMethod
return;
}
optionalBooleanArg = toBoolean(info.GetIsolate(), info[0], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
ScriptArguments* scriptArguments(ScriptArguments::create(scriptState, info, 1));
@@ -9246,7 +9363,6 @@ static void checkSecurityForNodeVoidMethodMethod(const v8::FunctionCallbackInfo<
TestObject* impl = V8TestObject::toImpl(info.Holder());
if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), currentDOMWindow(info.GetIsolate()), impl->checkSecurityForNodeVoidMethod(), exceptionState)) {
v8SetReturnValueNull(info);
- exceptionState.throwIfNeeded();
return;
}
impl->checkSecurityForNodeVoidMethod();
@@ -9358,8 +9474,9 @@ static void measureOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Va
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->measureOverloadedMethod(arg);
}
@@ -9386,7 +9503,6 @@ static void measureOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Val
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9408,8 +9524,9 @@ static void DeprecateAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->DeprecateAsOverloadedMethod(arg);
}
@@ -9436,7 +9553,6 @@ static void DeprecateAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8:
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9458,8 +9574,9 @@ static void DeprecateAsSameValueOverloadedMethod2Method(const v8::FunctionCallba
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->DeprecateAsSameValueOverloadedMethod(arg);
}
@@ -9485,7 +9602,6 @@ static void DeprecateAsSameValueOverloadedMethodMethod(const v8::FunctionCallbac
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9507,8 +9623,9 @@ static void measureAsOverloadedMethod2Method(const v8::FunctionCallbackInfo<v8::
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->measureAsOverloadedMethod(arg);
}
@@ -9535,7 +9652,6 @@ static void measureAsOverloadedMethodMethod(const v8::FunctionCallbackInfo<v8::V
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9557,8 +9673,9 @@ static void measureAsSameValueOverloadedMethod2Method(const v8::FunctionCallback
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->measureAsSameValueOverloadedMethod(arg);
}
@@ -9585,7 +9702,6 @@ static void measureAsSameValueOverloadedMethodMethod(const v8::FunctionCallbackI
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9607,8 +9723,9 @@ static void deprecateAsMeasureAsSameValueOverloadedMethod2Method(const v8::Funct
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->deprecateAsMeasureAsSameValueOverloadedMethod(arg);
}
@@ -9637,7 +9754,6 @@ static void deprecateAsMeasureAsSameValueOverloadedMethodMethod(const v8::Functi
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9659,8 +9775,9 @@ static void deprecateAsSameValueMeasureAsOverloadedMethod2Method(const v8::Funct
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->deprecateAsSameValueMeasureAsOverloadedMethod(arg);
}
@@ -9688,7 +9805,6 @@ static void deprecateAsSameValueMeasureAsOverloadedMethodMethod(const v8::Functi
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9710,8 +9826,9 @@ static void deprecateAsSameValueMeasureAsSameValueOverloadedMethod2Method(const
int arg;
{
arg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->deprecateAsSameValueMeasureAsSameValueOverloadedMethod(arg);
}
@@ -9739,7 +9856,6 @@ static void deprecateAsSameValueMeasureAsSameValueOverloadedMethodMethod(const v
break;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -9865,24 +9981,21 @@ void postMessageImpl(const char* interfaceName, TestObject* instance, const v8::
ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", interfaceName, info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
Transferables transferables;
if (info.Length() > 1) {
const int transferablesArgIndex = 1;
if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info[transferablesArgIndex], transferablesArgIndex, transferables, exceptionState)) {
- exceptionState.throwIfNeeded();
return;
}
}
RefPtr<SerializedScriptValue> message = SerializedScriptValue::serialize(info.GetIsolate(), info[0], &transferables, nullptr, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException())
return;
// FIXME: Only pass context/exceptionState if instance really requires it.
ExecutionContext* context = currentExecutionContext(info.GetIsolate());
instance->postMessage(context, message.release(), transferables.messagePorts, exceptionState);
- exceptionState.throwIfNeeded();
}
static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -9961,7 +10074,6 @@ static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::V
TestObject* impl = V8TestObject::toImpl(info.Holder());
impl->raisesExceptionVoidMethod(exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -9977,7 +10089,6 @@ static void raisesExceptionStringMethodMethod(const v8::FunctionCallbackInfo<v8:
TestObject* impl = V8TestObject::toImpl(info.Holder());
String result = impl->raisesExceptionStringMethod(exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValueString(info, result, info.GetIsolate());
@@ -10003,18 +10114,17 @@ static void raisesExceptionVoidMethodOptionalLongArgMethod(const v8::FunctionCal
if (UNLIKELY(numArgsPassed <= 0)) {
impl->raisesExceptionVoidMethodOptionalLongArg(exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
return;
}
optionalLongArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->raisesExceptionVoidMethodOptionalLongArg(optionalLongArg, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -10029,7 +10139,6 @@ static void raisesExceptionVoidMethodTestCallbackInterfaceArgMethod(const v8::Fu
ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExceptionVoidMethodTestCallbackInterfaceArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -10037,14 +10146,12 @@ static void raisesExceptionVoidMethodTestCallbackInterfaceArgMethod(const v8::Fu
{
if (info.Length() <= 0 || !info[0]->IsFunction()) {
exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
- exceptionState.throwIfNeeded();
return;
}
testCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Local<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate()));
}
impl->raisesExceptionVoidMethodTestCallbackInterfaceArg(testCallbackInterfaceArg, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -10063,7 +10170,6 @@ static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(cons
if (!isUndefinedOrNull(info[0])) {
if (!info[0]->IsFunction()) {
exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
- exceptionState.throwIfNeeded();
return;
}
optionalTestCallbackInterfaceArg = V8TestCallbackInterface::create(v8::Local<v8::Function>::Cast(info[0]), ScriptState::current(info.GetIsolate()));
@@ -10073,7 +10179,6 @@ static void raisesExceptionVoidMethodOptionalTestCallbackInterfaceArgMethod(cons
}
impl->raisesExceptionVoidMethodOptionalTestCallbackInterfaceArg(optionalTestCallbackInterfaceArg, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -10089,7 +10194,6 @@ static void raisesExceptionTestInterfaceEmptyVoidMethodMethod(const v8::Function
TestObject* impl = V8TestObject::toImpl(info.Holder());
TestInterfaceEmpty* result = impl->raisesExceptionTestInterfaceEmptyVoidMethod(exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -10106,7 +10210,6 @@ static void raisesExceptionXPathNSResolverVoidMethodMethod(const v8::FunctionCal
TestObject* impl = V8TestObject::toImpl(info.Holder());
XPathNSResolver* result = impl->raisesExceptionXPathNSResolverVoidMethod(exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -10122,20 +10225,19 @@ static void callWithExecutionContextRaisesExceptionVoidMethodLongArgMethod(const
ExceptionState exceptionState(ExceptionState::ExecutionContext, "callWithExecutionContextRaisesExceptionVoidMethodLongArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
impl->callWithExecutionContextRaisesExceptionVoidMethodLongArg(executionContext, longArg, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -10184,8 +10286,9 @@ static void runtimeEnabledOverloadedVoidMethod1Method(const v8::FunctionCallback
V8StringResource<> stringArg;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->runtimeEnabledOverloadedVoidMethod(stringArg);
}
@@ -10197,8 +10300,9 @@ static void runtimeEnabledOverloadedVoidMethod2Method(const v8::FunctionCallback
int longArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->runtimeEnabledOverloadedVoidMethod(longArg);
}
@@ -10226,11 +10330,9 @@ static void runtimeEnabledOverloadedVoidMethodMethod(const v8::FunctionCallbackI
}
if (info.Length() < 1) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -10245,8 +10347,9 @@ static void partiallyRuntimeEnabledOverloadedVoidMethod1Method(const v8::Functio
V8StringResource<> stringArg;
{
stringArg = info[0];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->partiallyRuntimeEnabledOverloadedVoidMethod(stringArg);
}
@@ -10273,11 +10376,13 @@ static void partiallyRuntimeEnabledOverloadedVoidMethod3Method(const v8::Functio
V8StringResource<> stringArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
stringArg = info[1];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
}
impl->partiallyRuntimeEnabledOverloadedVoidMethod(longArg, stringArg);
}
@@ -10291,15 +10396,16 @@ static void partiallyRuntimeEnabledOverloadedVoidMethod4Method(const v8::Functio
TestInterfaceImplementation* testInterfaceArg;
{
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
stringArg = info[1];
- if (!stringArg.prepare())
+ if (!stringArg.prepare()) {
return;
+ }
testInterfaceArg = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), info[2]);
if (!testInterfaceArg) {
exceptionState.throwTypeError("parameter 3 is not of type 'TestInterface'.");
- exceptionState.throwIfNeeded();
return;
}
}
@@ -10362,11 +10468,9 @@ static void partiallyRuntimeEnabledOverloadedVoidMethodMethod(const v8::Function
}
if (info.Length() < TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethodLength()) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(TestObjectV8Internal::partiallyRuntimeEnabledOverloadedVoidMethodMethodLength(), info.Length()));
- exceptionState.throwIfNeeded();
return;
}
exceptionState.throwTypeError("No function was found that matched the signature provided.");
- exceptionState.throwIfNeeded();
return;
}
@@ -10403,7 +10507,6 @@ static void legacyInterfaceTypeCheckingVoidMethodTestInterfaceEmptyVariadicArgMe
for (int i = 0; i < info.Length(); ++i) {
if (!V8TestInterfaceEmpty::hasInstance(info[i], info.GetIsolate())) {
exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceEmpty'.");
- exceptionState.throwIfNeeded();
return;
}
testInterfaceEmptyArg.append(V8TestInterfaceEmpty::toImpl(v8::Local<v8::Object>::Cast(info[i])));
@@ -10530,15 +10633,15 @@ static void voidMethodTestInterfaceGarbageCollectedSequenceArgMethod(const v8::F
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceGarbageCollectedSequenceArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
HeapVector<Member<TestInterfaceGarbageCollected>> testInterfaceGarbageCollectedSequenceArg;
{
testInterfaceGarbageCollectedSequenceArg = (toMemberNativeArray<TestInterfaceGarbageCollected>(info[0], 1, info.GetIsolate(), exceptionState));
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodTestInterfaceGarbageCollectedSequenceArg(testInterfaceGarbageCollectedSequenceArg);
}
@@ -10553,15 +10656,15 @@ static void voidMethodTestInterfaceGarbageCollectedArrayArgMethod(const v8::Func
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestInterfaceGarbageCollectedArrayArg", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
HeapVector<Member<TestInterfaceGarbageCollected>> testInterfaceGarbageCollectedArrayArg;
{
testInterfaceGarbageCollectedArrayArg = (toMemberNativeArray<TestInterfaceGarbageCollected>(info[0], 1, info.GetIsolate(), exceptionState));
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
impl->voidMethodTestInterfaceGarbageCollectedArrayArg(testInterfaceGarbageCollectedArrayArg);
}
@@ -10627,15 +10730,15 @@ static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v
ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethodWithShortArgumentImplementedInPrivateScript", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int value;
{
value = toInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
int result = 0;
if (!V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPrivateScriptMethod(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, value, &result))
@@ -10658,8 +10761,9 @@ static void stringMethodWithStringArgumentImplementedInPrivateScriptMethod(const
V8StringResource<> value;
{
value = info[0];
- if (!value.prepare())
+ if (!value.prepare()) {
return;
+ }
}
String result;
if (!V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPrivateScriptMethod(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, value, &result))
@@ -10703,7 +10807,6 @@ static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(const
ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodWithVariousArgumentsImplementedInPrivateScript", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 5)) {
setMinimumArityTypeError(exceptionState, 5, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -10716,24 +10819,25 @@ static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(const
document = V8Document::toImplWithTypeCheck(info.GetIsolate(), info[0]);
if (!document) {
exceptionState.throwTypeError("parameter 1 is not of type 'Document'.");
- exceptionState.throwIfNeeded();
return;
}
node = V8Node::toImplWithTypeCheck(info.GetIsolate(), info[1]);
if (!node) {
exceptionState.throwTypeError("parameter 2 is not of type 'Node'.");
- exceptionState.throwIfNeeded();
return;
}
value1 = toInt16(info.GetIsolate(), info[2], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
value2 = toRestrictedDouble(info.GetIsolate(), info[3], exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
string = info[4];
- if (!string.prepare())
+ if (!string.prepare()) {
return;
+ }
}
Node* result = nullptr;
if (!V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, document, node, value1, value2, string, &result))
@@ -10751,7 +10855,6 @@ static void methodImplementedInCPPForPrivateScriptOnlyMethod(const v8::FunctionC
ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodImplementedInCPPForPrivateScriptOnly", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
setMinimumArityTypeError(exceptionState, 2, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -10759,11 +10862,13 @@ static void methodImplementedInCPPForPrivateScriptOnlyMethod(const v8::FunctionC
int value2;
{
value1 = toInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
value2 = toInt16(info.GetIsolate(), info[1], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
v8SetReturnValueInt(info, impl->methodImplementedInCPPForPrivateScriptOnly(value1, value2));
}
@@ -10780,7 +10885,6 @@ static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->keysForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -10798,7 +10902,6 @@ static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -10816,7 +10919,6 @@ static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -10832,7 +10934,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -10841,7 +10942,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (!info[0]->IsFunction()) {
exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
- exceptionState.throwIfNeeded();
return;
}
callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
@@ -10850,7 +10950,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()), callback, thisArg, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -10865,20 +10964,19 @@ static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int key;
{
key = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->hasForBinding(scriptState, key, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValueBool(info, result);
@@ -10894,20 +10992,19 @@ static void getMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "get", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int key;
{
key = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
ScriptValue result = impl->getForBinding(scriptState, key, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result.v8Value());
@@ -10925,7 +11022,6 @@ static void clearMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
impl->clearForBinding(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
}
@@ -10940,20 +11036,19 @@ static void deleteMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "delete", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 1)) {
setMinimumArityTypeError(exceptionState, 1, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
int key;
{
key = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->deleteForBinding(scriptState, key, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValueBool(info, result);
@@ -10969,7 +11064,6 @@ static void setMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ExceptionState exceptionState(ExceptionState::ExecutionContext, "set", "TestObject", info.Holder(), info.GetIsolate());
if (UNLIKELY(info.Length() < 2)) {
setMinimumArityTypeError(exceptionState, 2, info.Length());
- exceptionState.throwIfNeeded();
return;
}
TestObject* impl = V8TestObject::toImpl(info.Holder());
@@ -10977,16 +11071,17 @@ static void setMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
StringOrDouble value;
{
key = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
V8StringOrDouble::toImpl(info.GetIsolate(), info[1], value, UnionTypeConversionMode::NotNullable, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return;
+ }
}
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
TestObject* result = impl->setForBinding(scriptState, key, value, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -11026,7 +11121,6 @@ static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
Iterator* result = impl->iterator(scriptState, exceptionState);
if (exceptionState.hadException()) {
- exceptionState.throwIfNeeded();
return;
}
v8SetReturnValue(info, result);
@@ -11056,8 +11150,9 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
{
TestObject* impl = V8TestObject::toImpl(info.Holder());
V8StringResource<> propertyValue = v8Value;
- if (!propertyValue.prepare())
+ if (!propertyValue.prepare()) {
return;
+ }
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->setItem(scriptState, index, propertyValue);
if (!result)
@@ -11076,7 +11171,7 @@ static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestObject", info.Holder(), info.GetIsolate());
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
DeleteResult result = impl->anonymousIndexedDeleter(scriptState, index, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException())
return;
if (result != DeleteUnknownProperty)
return v8SetReturnValueBool(info, result == DeleteSuccess);
@@ -11114,8 +11209,9 @@ static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
if (!propertyName.prepare())
return;
V8StringResource<> propertyValue = v8Value;
- if (!propertyValue.prepare())
+ if (!propertyValue.prepare()) {
return;
+ }
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->anonymousNamedSetter(scriptState, propertyName, propertyValue);
if (!result)
@@ -11138,7 +11234,7 @@ static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestObject", info.Holder(), info.GetIsolate());
ScriptState* scriptState = ScriptState::current(info.GetIsolate());
bool result = impl->namedPropertyQuery(scriptState, propertyName, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException())
return;
if (!result)
return;
@@ -11175,7 +11271,7 @@ static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
Vector<String> names;
ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestObject", info.Holder(), info.GetIsolate());
impl->namedPropertyEnumerator(names, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException())
return;
v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size());
for (size_t i = 0; i < names.size(); ++i) {
@@ -11881,8 +11977,9 @@ bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
if (v8Value.IsEmpty())
return false;
int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return false;
+ }
*result = cppValue;
RELEASE_ASSERT(!exceptionState.hadException());
return true;
@@ -11913,8 +12010,9 @@ bool V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPriva
if (v8Value.IsEmpty())
return false;
int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return false;
+ }
*result = cppValue;
RELEASE_ASSERT(!exceptionState.hadException());
return true;
@@ -11945,8 +12043,9 @@ bool V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPri
if (v8Value.IsEmpty())
return false;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return false;
+ }
*result = cppValue;
RELEASE_ASSERT(!exceptionState.hadException());
return true;
@@ -12042,8 +12141,9 @@ bool V8TestObject::PrivateScript::methodForPrivateScriptOnlyMethod(LocalFrame* f
if (v8Value.IsEmpty())
return false;
int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return false;
+ }
*result = cppValue;
RELEASE_ASSERT(!exceptionState.hadException());
return true;
@@ -12073,8 +12173,9 @@ bool V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(LocalFra
if (v8Value.IsEmpty())
return false;
int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return false;
+ }
RELEASE_ASSERT(!exceptionState.hadException());
*result = cppValue;
return true;
@@ -12104,8 +12205,9 @@ bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
if (v8Value.IsEmpty())
return false;
int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, exceptionState);
- if (exceptionState.throwIfNeeded())
+ if (exceptionState.hadException()) {
return false;
+ }
RELEASE_ASSERT(!exceptionState.hadException());
*result = cppValue;
return true;
@@ -12157,8 +12259,9 @@ bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
if (v8Value.IsEmpty())
return false;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return false;
+ }
RELEASE_ASSERT(!exceptionState.hadException());
*result = cppValue;
return true;
@@ -12261,8 +12364,9 @@ bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
if (v8Value.IsEmpty())
return false;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return false;
+ }
RELEASE_ASSERT(!exceptionState.hadException());
*result = cppValue;
return true;
@@ -12314,8 +12418,9 @@ bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame
if (v8Value.IsEmpty())
return false;
V8StringResource<> cppValue = v8Value;
- if (!cppValue.prepare())
+ if (!cppValue.prepare()) {
return false;
+ }
RELEASE_ASSERT(!exceptionState.hadException());
*result = cppValue;
return true;

Powered by Google App Engine
This is Rietveld 408576698