| Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
|
| index d4f59795ef17ea1694af4b917746f21cb6973eb9..b66cf8fafb741ae720cd99732dedcc417faa47a3 100644
|
| --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
|
| +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
|
| @@ -46,19 +46,18 @@ static void itemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "item", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 1)) {
|
| setMinimumArityTypeError(exceptionState, 1, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| unsigned index;
|
| {
|
| index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException()) {
|
| return;
|
| + }
|
| }
|
| TestInterfaceEmpty* result = impl->item(index, exceptionState);
|
| if (exceptionState.hadException()) {
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| v8SetReturnValue(info, result);
|
| @@ -74,7 +73,6 @@ static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "setItem", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 2)) {
|
| setMinimumArityTypeError(exceptionState, 2, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| @@ -82,18 +80,17 @@ static void setItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| TestInterfaceEmpty* value;
|
| {
|
| index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException()) {
|
| return;
|
| + }
|
| value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]);
|
| if (!value) {
|
| exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| }
|
| TestInterfaceEmpty* result = impl->setItem(index, value, exceptionState);
|
| if (exceptionState.hadException()) {
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| v8SetReturnValue(info, result);
|
| @@ -109,19 +106,18 @@ static void deleteItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteItem", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 1)) {
|
| setMinimumArityTypeError(exceptionState, 1, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| unsigned index;
|
| {
|
| index = toUInt32(info.GetIsolate(), info[0], NormalConversion, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException()) {
|
| return;
|
| + }
|
| }
|
| bool result = impl->deleteItem(index, exceptionState);
|
| if (exceptionState.hadException()) {
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| v8SetReturnValueBool(info, result);
|
| @@ -137,19 +133,18 @@ static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "namedItem", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 1)) {
|
| setMinimumArityTypeError(exceptionState, 1, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| V8StringResource<> name;
|
| {
|
| name = info[0];
|
| - if (!name.prepare())
|
| + if (!name.prepare()) {
|
| return;
|
| + }
|
| }
|
| TestInterfaceEmpty* result = impl->namedItem(name, exceptionState);
|
| if (exceptionState.hadException()) {
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| v8SetReturnValue(info, result);
|
| @@ -165,7 +160,6 @@ static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "setNamedItem", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 2)) {
|
| setMinimumArityTypeError(exceptionState, 2, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| @@ -173,18 +167,17 @@ static void setNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| TestInterfaceEmpty* value;
|
| {
|
| name = info[0];
|
| - if (!name.prepare())
|
| + if (!name.prepare()) {
|
| return;
|
| + }
|
| value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]);
|
| if (!value && !isUndefinedOrNull(info[1])) {
|
| exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| }
|
| TestInterfaceEmpty* result = impl->setNamedItem(name, value, exceptionState);
|
| if (exceptionState.hadException()) {
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| v8SetReturnValue(info, result);
|
| @@ -200,19 +193,18 @@ static void deleteNamedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "deleteNamedItem", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 1)) {
|
| setMinimumArityTypeError(exceptionState, 1, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| V8StringResource<> name;
|
| {
|
| name = info[0];
|
| - if (!name.prepare())
|
| + if (!name.prepare()) {
|
| return;
|
| + }
|
| }
|
| bool result = impl->deleteNamedItem(name, exceptionState);
|
| if (exceptionState.hadException()) {
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| v8SetReturnValueBool(info, result);
|
| @@ -241,7 +233,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);
|
| @@ -259,7 +250,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);
|
| @@ -277,7 +267,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);
|
| @@ -293,7 +282,6 @@ static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 1)) {
|
| setMinimumArityTypeError(exceptionState, 1, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| @@ -302,7 +290,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]);
|
| @@ -311,7 +298,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;
|
| }
|
| }
|
| @@ -326,7 +312,6 @@ static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| ExceptionState exceptionState(ExceptionState::ExecutionContext, "has", "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (UNLIKELY(info.Length() < 1)) {
|
| setMinimumArityTypeError(exceptionState, 1, info.Length());
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| @@ -335,14 +320,12 @@ static void hasMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| value = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]);
|
| if (!value) {
|
| exceptionState.throwTypeError("parameter 1 is not of type 'TestInterfaceEmpty'.");
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| }
|
| ScriptState* scriptState = ScriptState::current(info.GetIsolate());
|
| bool result = impl->hasForBinding(scriptState, value, exceptionState);
|
| if (exceptionState.hadException()) {
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| v8SetReturnValueBool(info, result);
|
| @@ -371,7 +354,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);
|
| @@ -395,7 +377,7 @@ static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| ExceptionState exceptionState(ExceptionState::IndexedGetterContext, "TestInterface2", info.Holder(), info.GetIsolate());
|
| TestInterfaceEmpty* result = impl->item(index, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException())
|
| return;
|
| if (!result)
|
| return;
|
| @@ -414,11 +396,10 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
|
| ExceptionState exceptionState(ExceptionState::IndexedSetterContext, "TestInterface2", info.Holder(), info.GetIsolate());
|
| if (!propertyValue) {
|
| exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceEmpty'.");
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| bool result = impl->setItem(index, propertyValue, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException())
|
| return;
|
| if (!result)
|
| return;
|
| @@ -435,7 +416,7 @@ static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
|
| TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
|
| ExceptionState exceptionState(ExceptionState::IndexedDeletionContext, "TestInterface2", info.Holder(), info.GetIsolate());
|
| DeleteResult result = impl->deleteItem(index, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException())
|
| return;
|
| if (result != DeleteUnknownProperty)
|
| return v8SetReturnValueBool(info, result == DeleteSuccess);
|
| @@ -454,7 +435,7 @@ static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall
|
| v8::String::Utf8Value namedProperty(nameString);
|
| ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate());
|
| TestInterfaceEmpty* result = impl->namedItem(propertyName, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException())
|
| return;
|
| if (!result)
|
| return;
|
| @@ -480,11 +461,10 @@ static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v
|
| TestInterfaceEmpty* propertyValue = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), v8Value);
|
| if (!propertyValue && !isUndefinedOrNull(v8Value)) {
|
| exceptionState.throwTypeError("The provided value is not of type 'TestInterfaceEmpty'.");
|
| - exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| bool result = impl->setNamedItem(propertyName, propertyValue, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException())
|
| return;
|
| if (!result)
|
| return;
|
| @@ -505,7 +485,7 @@ static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb
|
| v8::String::Utf8Value namedProperty(name);
|
| ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate());
|
| bool result = impl->namedPropertyQuery(propertyName, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException())
|
| return;
|
| if (!result)
|
| return;
|
| @@ -526,7 +506,7 @@ static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal
|
| v8::String::Utf8Value namedProperty(name);
|
| ExceptionState exceptionState(ExceptionState::DeletionContext, *namedProperty, "TestInterface2", info.Holder(), info.GetIsolate());
|
| DeleteResult result = impl->deleteNamedItem(propertyName, exceptionState);
|
| - if (exceptionState.throwIfNeeded())
|
| + if (exceptionState.hadException())
|
| return;
|
| if (result != DeleteUnknownProperty)
|
| return v8SetReturnValueBool(info, result == DeleteSuccess);
|
| @@ -545,7 +525,7 @@ static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
|
| Vector<String> names;
|
| ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInterface2", 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) {
|
|
|