Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
index 4fee8f1ce28f0c3cdd3460917155556b9e73a4ee..7c8985503e47042535f836f4f652d07427688d55 100644 |
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp |
@@ -82,7 +82,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); |
@@ -113,8 +112,9 @@ static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v |
ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setDoubleAttribute(cppValue); |
} |
@@ -142,8 +142,9 @@ static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 |
ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setFloatAttribute(cppValue); |
} |
@@ -171,8 +172,9 @@ static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va |
ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedDoubleAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setUnrestrictedDoubleAttribute(cppValue); |
} |
@@ -200,8 +202,9 @@ static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val |
ExceptionState exceptionState(ExceptionState::SetterContext, "unrestrictedFloatAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setUnrestrictedFloatAttribute(cppValue); |
} |
@@ -229,8 +232,9 @@ static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const |
ExceptionState exceptionState(ExceptionState::SetterContext, "testEnumAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
const char* validValues[] = { |
"", |
"EnumValue1", |
@@ -271,8 +275,9 @@ static void stringOrDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
StringOrDouble cppValue; |
V8StringOrDouble::toImpl(info.GetIsolate(), v8Value, cppValue, UnionTypeConversionMode::NotNullable, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setStringOrDoubleAttribute(cppValue); |
} |
@@ -300,8 +305,9 @@ static void conditionalLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value |
ExceptionState exceptionState(ExceptionState::SetterContext, "conditionalLongAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setConditionalLongAttribute(cppValue); |
} |
@@ -336,8 +342,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; |
+ } |
TestInterfaceImplementation::setStaticStringAttribute(cppValue); |
} |
@@ -364,7 +371,6 @@ static void staticReturnDOMWrapperAttributeAttributeSetter(v8::Local<v8::Value> |
TestInterfaceImplementation* cppValue = V8TestInterface::toImplWithTypeCheck(info.GetIsolate(), v8Value); |
if (!cppValue) { |
exceptionState.throwTypeError("The provided value is not of type 'TestInterface'."); |
- exceptionState.throwIfNeeded(); |
return; |
} |
TestInterfaceImplementation::setStaticReturnDOMWrapperAttribute(cppValue); |
@@ -457,8 +463,9 @@ static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, |
ExceptionState exceptionState(ExceptionState::SetterContext, "alwaysExposedAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setAlwaysExposedAttribute(cppValue); |
} |
@@ -486,8 +493,9 @@ static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, |
ExceptionState exceptionState(ExceptionState::SetterContext, "workerExposedAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setWorkerExposedAttribute(cppValue); |
} |
@@ -515,8 +523,9 @@ static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, |
ExceptionState exceptionState(ExceptionState::SetterContext, "windowExposedAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
impl->setWindowExposedAttribute(cppValue); |
} |
@@ -579,8 +588,9 @@ static void implementsStaticStringAttributeAttributeGetterCallback(const v8::Fun |
static void implementsStaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
TestInterfaceImplementation::setImplementsStaticStringAttribute(cppValue); |
} |
@@ -619,8 +629,9 @@ static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> v8Valu |
v8::Local<v8::Object> holder = info.Holder(); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
impl->setImplementsStringAttribute(cppValue); |
} |
@@ -650,7 +661,6 @@ static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, |
Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); |
if (!cppValue) { |
exceptionState.throwTypeError("The provided value is not of type 'Node'."); |
- exceptionState.throwIfNeeded(); |
return; |
} |
impl->setImplementsNodeAttribute(cppValue); |
@@ -709,7 +719,6 @@ static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V |
Node* cppValue = V8Node::toImplWithTypeCheck(info.GetIsolate(), v8Value); |
if (!cppValue) { |
exceptionState.throwTypeError("The provided value is not of type 'Node'."); |
- exceptionState.throwIfNeeded(); |
return; |
} |
impl->setImplementsRuntimeEnabledNodeAttribute(cppValue); |
@@ -734,8 +743,9 @@ static void implements2StaticStringAttributeAttributeGetterCallback(const v8::Fu |
static void implements2StaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
TestImplements2::setImplements2StaticStringAttribute(cppValue); |
} |
@@ -762,8 +772,9 @@ static void implements2StringAttributeAttributeSetter(v8::Local<v8::Value> v8Val |
v8::Local<v8::Object> holder = info.Holder(); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
TestImplements2::setImplements2StringAttribute(*impl, cppValue); |
} |
@@ -790,8 +801,9 @@ static void implements3StringAttributeAttributeSetter(v8::Local<v8::Value> v8Val |
v8::Local<v8::Object> holder = info.Holder(); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
TestImplements3Implementation::setImplements3StringAttribute(*impl, cppValue); |
} |
@@ -814,8 +826,9 @@ static void implements3StaticStringAttributeAttributeGetterCallback(const v8::Fu |
static void implements3StaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
TestImplements3Implementation::setImplements3StaticStringAttribute(cppValue); |
} |
@@ -843,8 +856,9 @@ static void partialLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, co |
ExceptionState exceptionState(ExceptionState::SetterContext, "partialLongAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
TestInterfacePartial::setPartialLongAttribute(*impl, cppValue); |
} |
@@ -869,8 +883,9 @@ static void partialStaticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Val |
v8::Local<v8::Object> holder = info.Holder(); |
ExceptionState exceptionState(ExceptionState::SetterContext, "partialStaticLongAttribute", "TestInterface", holder, info.GetIsolate()); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
TestInterfacePartial::setPartialStaticLongAttribute(cppValue); |
} |
@@ -899,8 +914,9 @@ static void partialCallWithExecutionContextLongAttributeAttributeSetter(v8::Loca |
ExceptionState exceptionState(ExceptionState::SetterContext, "partialCallWithExecutionContextLongAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); |
TestInterfacePartial::setPartialCallWithExecutionContextLongAttribute(executionContext, *impl, cppValue); |
} |
@@ -929,8 +945,9 @@ static void partialPartialEnumTypeAttributeAttributeSetter(v8::Local<v8::Value> |
ExceptionState exceptionState(ExceptionState::SetterContext, "partialPartialEnumTypeAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
const char* validValues[] = { |
"foo", |
"bar", |
@@ -968,8 +985,9 @@ static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v |
v8::Local<v8::Object> holder = info.Holder(); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
V8StringResource<> cppValue = v8Value; |
- if (!cppValue.prepare()) |
+ if (!cppValue.prepare()) { |
return; |
+ } |
V8TestInterface::PrivateScript::stringAttributeAttributeSetter(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, cppValue); |
} |
@@ -997,8 +1015,9 @@ static void partial2LongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c |
ExceptionState exceptionState(ExceptionState::SetterContext, "partial2LongAttribute", "TestInterface", holder, info.GetIsolate()); |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
TestInterfacePartial2Implementation::setPartial2LongAttribute(*impl, cppValue); |
} |
@@ -1023,8 +1042,9 @@ static void partial2StaticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Va |
v8::Local<v8::Object> holder = info.Holder(); |
ExceptionState exceptionState(ExceptionState::SetterContext, "partial2StaticLongAttribute", "TestInterface", holder, info.GetIsolate()); |
int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
TestInterfacePartial2Implementation::setPartial2StaticLongAttribute(cppValue); |
} |
@@ -1062,7 +1082,6 @@ static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodDoubleArgFloatArg", "TestInterface", info.Holder(), info.GetIsolate()); |
if (UNLIKELY(info.Length() < 2)) { |
setMinimumArityTypeError(exceptionState, 2, info.Length()); |
- exceptionState.throwIfNeeded(); |
return; |
} |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
@@ -1070,11 +1089,13 @@ static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: |
float floatArg; |
{ |
doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
} |
impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); |
} |
@@ -1089,7 +1110,6 @@ static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", "TestInterface", info.Holder(), info.GetIsolate()); |
if (UNLIKELY(info.Length() < 2)) { |
setMinimumArityTypeError(exceptionState, 2, info.Length()); |
- exceptionState.throwIfNeeded(); |
return; |
} |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
@@ -1097,11 +1117,13 @@ static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: |
float unrestrictedFloatArg; |
{ |
unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
} |
impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleArg, unrestrictedFloatArg); |
} |
@@ -1116,15 +1138,15 @@ static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestEnumArg", "TestInterface", info.Holder(), info.GetIsolate()); |
if (UNLIKELY(info.Length() < 1)) { |
setMinimumArityTypeError(exceptionState, 1, info.Length()); |
- exceptionState.throwIfNeeded(); |
return; |
} |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
V8StringResource<> testEnumArg; |
{ |
testEnumArg = info[0]; |
- if (!testEnumArg.prepare()) |
+ if (!testEnumArg.prepare()) { |
return; |
+ } |
const char* validValues[] = { |
"", |
"EnumValue1", |
@@ -1132,7 +1154,6 @@ static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value |
"EnumValue3", |
}; |
if (!isValidEnum(testEnumArg, validValues, WTF_ARRAY_LENGTH(validValues), "TestEnum", exceptionState)) { |
- exceptionState.throwIfNeeded(); |
return; |
} |
} |
@@ -1257,8 +1278,9 @@ static void overloadMethodWithExposedAndRuntimeEnabledFlag1Method(const v8::Func |
int longArg; |
{ |
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
} |
impl->overloadMethodWithExposedAndRuntimeEnabledFlag(longArg); |
} |
@@ -1269,8 +1291,9 @@ static void overloadMethodWithExposedAndRuntimeEnabledFlag2Method(const v8::Func |
V8StringResource<> string; |
{ |
string = info[0]; |
- if (!string.prepare()) |
+ if (!string.prepare()) { |
return; |
+ } |
} |
impl->overloadMethodWithExposedAndRuntimeEnabledFlag(string); |
} |
@@ -1320,11 +1343,9 @@ static void overloadMethodWithExposedAndRuntimeEnabledFlagMethod(const v8::Funct |
} |
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; |
} |
@@ -1368,8 +1389,9 @@ static void voidMethodPartialOverload2Method(const v8::FunctionCallbackInfo<v8:: |
double doubleArg; |
{ |
doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
} |
impl->voidMethodPartialOverload(doubleArg); |
} |
@@ -1439,7 +1461,6 @@ static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsComplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); |
if (UNLIKELY(info.Length() < 2)) { |
setMinimumArityTypeError(exceptionState, 2, info.Length()); |
- exceptionState.throwIfNeeded(); |
return; |
} |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
@@ -1447,19 +1468,18 @@ static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val |
TestInterfaceEmpty* testInterfaceEmptyArg; |
{ |
strArg = info[0]; |
- if (!strArg.prepare()) |
+ if (!strArg.prepare()) { |
return; |
+ } |
testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]); |
if (!testInterfaceEmptyArg) { |
exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'."); |
- exceptionState.throwIfNeeded(); |
return; |
} |
} |
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); |
TestInterfaceEmpty* result = impl->implementsComplexMethod(executionContext, strArg, testInterfaceEmptyArg, exceptionState); |
if (exceptionState.hadException()) { |
- exceptionState.throwIfNeeded(); |
return; |
} |
v8SetReturnValue(info, result); |
@@ -1543,15 +1563,15 @@ static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Va |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoidMethodLongArg", "TestInterface", info.Holder(), info.GetIsolate()); |
if (UNLIKELY(info.Length() < 1)) { |
setMinimumArityTypeError(exceptionState, 1, info.Length()); |
- exceptionState.throwIfNeeded(); |
return; |
} |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
int longArg; |
{ |
longArg = toInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
} |
TestInterfacePartial::partialVoidMethodLongArg(*impl, longArg); |
} |
@@ -1568,7 +1588,6 @@ static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(const |
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); |
TestInterfacePartial::partialCallWithExecutionContextRaisesExceptionVoidMethod(executionContext, *impl, exceptionState); |
if (exceptionState.hadException()) { |
- exceptionState.throwIfNeeded(); |
return; |
} |
} |
@@ -1606,15 +1625,15 @@ static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethodWithShortArgumentImplementedInPrivateScript", "TestInterface", info.Holder(), info.GetIsolate()); |
if (UNLIKELY(info.Length() < 1)) { |
setMinimumArityTypeError(exceptionState, 1, info.Length()); |
- exceptionState.throwIfNeeded(); |
return; |
} |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
int value; |
{ |
value = toInt16(info.GetIsolate(), info[0], NormalConversion, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) { |
return; |
+ } |
} |
int result = 0; |
if (!V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPrivateScriptMethod(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, value, &result)) |
@@ -1789,7 +1808,6 @@ static void toJSONMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
ScriptValue result = impl->toJSONForBinding(scriptState, exceptionState); |
if (exceptionState.hadException()) { |
- exceptionState.throwIfNeeded(); |
return; |
} |
v8SetReturnValue(info, result.v8Value()); |
@@ -1818,7 +1836,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); |
@@ -1847,8 +1864,9 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, |
{ |
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); |
V8StringResource<> propertyValue = v8Value; |
- if (!propertyValue.prepare()) |
+ if (!propertyValue.prepare()) { |
return; |
+ } |
bool result = impl->anonymousIndexedSetter(index, propertyValue); |
if (!result) |
return; |
@@ -1899,8 +1917,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; |
+ } |
bool result = impl->anonymousNamedSetter(propertyName, propertyValue); |
if (!result) |
return; |
@@ -1921,7 +1940,7 @@ static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb |
v8::String::Utf8Value namedProperty(name); |
ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface", info.Holder(), info.GetIsolate()); |
bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
- if (exceptionState.throwIfNeeded()) |
+ if (exceptionState.hadException()) |
return; |
if (!result) |
return; |
@@ -1957,7 +1976,7 @@ static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i |
Vector<String> names; |
ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInterface", 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) { |
@@ -2273,8 +2292,9 @@ bool V8TestInterface::PrivateScript::shortMethodWithShortArgumentImplementedInPr |
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; |
@@ -2304,8 +2324,9 @@ bool V8TestInterface::PrivateScript::stringAttributeAttributeGetter(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; |