Title: [124985] trunk/Source/WebCore
Revision
124985
Author
[email protected]
Date
2012-08-07 22:06:32 -0700 (Tue, 07 Aug 2012)

Log Message

[V8] Replace throwError(ExceptionCode, Isolate*) with setDOMException(ExceptionCode, Isolate*) in v8/* and v8/custom/*
https://bugs.webkit.org/show_bug.cgi?id=93226

Reviewed by Eric Seidel.

Now throwError(ExceptionCode, Isolate*) is equivalent to
setDOMException(ExceptionCode, Isolate*). We can replace the former with
the latter. After this replacement, the rule becomes simple and sane:
"Use throwError() for throwing _javascript_ errors, use setDOMException()
for throwing DOM exceptions".

No tests. No change in behavior.

* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::transferArrayBuffers):
(WebCore::SerializedScriptValue::SerializedScriptValue):
* bindings/v8/custom/V8AudioContextCustom.cpp:
(WebCore::V8AudioContext::constructorCallback):
* bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
(WebCore::V8CSSStyleDeclaration::namedPropertySetter):
* bindings/v8/custom/V8DOMStringMapCustom.cpp:
(WebCore::V8DOMStringMap::namedPropertySetter):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8DirectoryEntryCustom.cpp:
(WebCore::V8DirectoryEntry::getDirectoryCallback):
(WebCore::V8DirectoryEntry::getFileCallback):
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::V8Document::evaluateCallback):
* bindings/v8/custom/V8HistoryCustom.cpp:
(WebCore::V8History::pushStateCallback):
(WebCore::V8History::replaceStateCallback):
* bindings/v8/custom/V8IntentConstructor.cpp:
(WebCore::V8Intent::constructorCallback):
* bindings/v8/custom/V8MessagePortCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8MutationObserverCustom.cpp:
(WebCore::V8MutationObserver::constructorCallback):
* bindings/v8/custom/V8NotificationCenterCustom.cpp:
(WebCore::V8NotificationCenter::createHTMLNotificationCallback):
(WebCore::V8NotificationCenter::createNotificationCallback):
(WebCore::V8NotificationCenter::requestPermissionCallback):
* bindings/v8/custom/V8SQLTransactionCustom.cpp:
(WebCore::V8SQLTransaction::executeSqlCallback):
* bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
(WebCore::V8SQLTransactionSync::executeSqlCallback):
* bindings/v8/custom/V8StorageCustom.cpp:
(WebCore::storageSetter):
* bindings/v8/custom/V8WebSocketCustom.cpp:
(WebCore::V8WebSocket::constructorCallback):
(WebCore::V8WebSocket::sendCallback):
* bindings/v8/custom/V8WorkerContextCustom.cpp:
(WebCore::V8WorkerContext::importScriptsCallback):
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore::handlePostMessageCallback):
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
(WebCore::V8XMLHttpRequest::responseTextAccessorGetter):
(WebCore::V8XMLHttpRequest::openCallback):
(WebCore::V8XMLHttpRequest::sendCallback):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124984 => 124985)


--- trunk/Source/WebCore/ChangeLog	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/ChangeLog	2012-08-08 05:06:32 UTC (rev 124985)
@@ -1,5 +1,69 @@
 2012-08-07  Kentaro Hara  <[email protected]>
 
+        [V8] Replace throwError(ExceptionCode, Isolate*) with setDOMException(ExceptionCode, Isolate*) in v8/* and v8/custom/*
+        https://bugs.webkit.org/show_bug.cgi?id=93226
+
+        Reviewed by Eric Seidel.
+
+        Now throwError(ExceptionCode, Isolate*) is equivalent to
+        setDOMException(ExceptionCode, Isolate*). We can replace the former with
+        the latter. After this replacement, the rule becomes simple and sane:
+        "Use throwError() for throwing _javascript_ errors, use setDOMException()
+        for throwing DOM exceptions".
+
+        No tests. No change in behavior.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::SerializedScriptValue::transferArrayBuffers):
+        (WebCore::SerializedScriptValue::SerializedScriptValue):
+        * bindings/v8/custom/V8AudioContextCustom.cpp:
+        (WebCore::V8AudioContext::constructorCallback):
+        * bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
+        (WebCore::V8CSSStyleDeclaration::namedPropertySetter):
+        * bindings/v8/custom/V8DOMStringMapCustom.cpp:
+        (WebCore::V8DOMStringMap::namedPropertySetter):
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::handlePostMessageCallback):
+        * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
+        (WebCore::handlePostMessageCallback):
+        * bindings/v8/custom/V8DirectoryEntryCustom.cpp:
+        (WebCore::V8DirectoryEntry::getDirectoryCallback):
+        (WebCore::V8DirectoryEntry::getFileCallback):
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        (WebCore::V8Document::evaluateCallback):
+        * bindings/v8/custom/V8HistoryCustom.cpp:
+        (WebCore::V8History::pushStateCallback):
+        (WebCore::V8History::replaceStateCallback):
+        * bindings/v8/custom/V8IntentConstructor.cpp:
+        (WebCore::V8Intent::constructorCallback):
+        * bindings/v8/custom/V8MessagePortCustom.cpp:
+        (WebCore::handlePostMessageCallback):
+        * bindings/v8/custom/V8MutationObserverCustom.cpp:
+        (WebCore::V8MutationObserver::constructorCallback):
+        * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+        (WebCore::V8NotificationCenter::createHTMLNotificationCallback):
+        (WebCore::V8NotificationCenter::createNotificationCallback):
+        (WebCore::V8NotificationCenter::requestPermissionCallback):
+        * bindings/v8/custom/V8SQLTransactionCustom.cpp:
+        (WebCore::V8SQLTransaction::executeSqlCallback):
+        * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
+        (WebCore::V8SQLTransactionSync::executeSqlCallback):
+        * bindings/v8/custom/V8StorageCustom.cpp:
+        (WebCore::storageSetter):
+        * bindings/v8/custom/V8WebSocketCustom.cpp:
+        (WebCore::V8WebSocket::constructorCallback):
+        (WebCore::V8WebSocket::sendCallback):
+        * bindings/v8/custom/V8WorkerContextCustom.cpp:
+        (WebCore::V8WorkerContext::importScriptsCallback):
+        * bindings/v8/custom/V8WorkerCustom.cpp:
+        (WebCore::handlePostMessageCallback):
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::responseTextAccessorGetter):
+        (WebCore::V8XMLHttpRequest::openCallback):
+        (WebCore::V8XMLHttpRequest::sendCallback):
+
+2012-08-07  Kentaro Hara  <[email protected]>
+
         [V8] Replace v8::Handle<v8::Value>() in custom bindings with v8Undefined()
         https://bugs.webkit.org/show_bug.cgi?id=93215
 

Modified: trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -2221,7 +2221,7 @@
 {
     for (size_t i = 0; i < arrayBuffers.size(); i++) {
         if (arrayBuffers[i]->isNeutered()) {
-            throwError(INVALID_STATE_ERR, isolate);
+            V8Proxy::setDOMException(INVALID_STATE_ERR, isolate);
             didThrow = true;
             return nullptr;
         }
@@ -2239,7 +2239,7 @@
 
         bool result = arrayBuffers[i]->transfer(contents->at(i), neuteredViews);
         if (!result) {
-            throwError(INVALID_STATE_ERR, isolate);
+            V8Proxy::setDOMException(INVALID_STATE_ERR, isolate);
             didThrow = true;
             return nullptr;
         }
@@ -2277,11 +2277,11 @@
         // If there was an input error, throw a new exception outside
         // of the TryCatch scope.
         didThrow = true;
-        throwError(DATA_CLONE_ERR, isolate);
+        V8Proxy::setDOMException(DATA_CLONE_ERR, isolate);
         return;
     case Serializer::InvalidStateError:
         didThrow = true;
-        throwError(INVALID_STATE_ERR, isolate);
+        V8Proxy::setDOMException(INVALID_STATE_ERR, isolate);
         return;
     case Serializer::JSFailure:
         // If there was a JS failure (but no exception), there's not

Modified: trunk/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -65,7 +65,7 @@
         ExceptionCode ec = 0;
         audioContext = AudioContext::create(document, ec);
         if (ec)
-            return throwError(ec, args.GetIsolate());
+            return V8Proxy::setDOMException(ec, args.GetIsolate());
         if (!audioContext.get())
             return V8Proxy::throwError(V8Proxy::SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate());
     } else {
@@ -91,7 +91,7 @@
         ExceptionCode ec = 0;
         audioContext = AudioContext::createOfflineContext(document, numberOfChannels, numberOfFrames, sampleRate, ec);
         if (ec)
-            return throwError(ec, args.GetIsolate());
+            return V8Proxy::setDOMException(ec, args.GetIsolate());
     }
 
     if (!audioContext.get())

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -238,7 +238,7 @@
     imp->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), propertyValue, false, ec);
 
     if (ec)
-        throwError(ec, info.GetIsolate());
+        V8Proxy::setDOMException(ec, info.GetIsolate());
 
     return value;
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -80,7 +80,7 @@
     ExceptionCode ec = 0;
     V8DOMStringMap::toNative(info.Holder())->setItem(toWebCoreString(name), toWebCoreString(value), ec);
     if (ec)
-        return throwError(ec, info.GetIsolate());
+        return V8Proxy::setDOMException(ec, info.GetIsolate());
     return value;
 }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -345,7 +345,7 @@
 
     ExceptionCode ec = 0;
     window->postMessage(message.release(), &portArray, targetOrigin, source, ec);
-    return throwError(ec, args.GetIsolate());
+    return V8Proxy::setDOMException(ec, args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8DOMWindow::postMessageCallback(const v8::Arguments& args)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -63,7 +63,7 @@
         return v8::Undefined();
     ExceptionCode ec = 0;
     workerContext->postMessage(message.release(), &ports, ec);
-    return throwError(ec, args.GetIsolate());
+    return V8Proxy::setDOMException(ec, args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8DedicatedWorkerContext::postMessageCallback(const v8::Arguments& args)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntryCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -75,13 +75,13 @@
     RefPtr<EntryCallback> successCallback;
     if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
         if (!args[2]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
         successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
     }
     RefPtr<ErrorCallback> errorCallback;
     if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
         if (!args[3]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
         errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
     }
     imp->getDirectory(path, flags, successCallback, errorCallback);
@@ -119,13 +119,13 @@
     RefPtr<EntryCallback> successCallback;
     if (args.Length() > 2 && !args[2]->IsNull() && !args[2]->IsUndefined()) {
         if (!args[2]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
         successCallback = V8EntryCallback::create(args[2], getScriptExecutionContext());
     }
     RefPtr<ErrorCallback> errorCallback;
     if (args.Length() > 3 && !args[3]->IsNull() && !args[3]->IsUndefined()) {
         if (!args[3]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
         errorCallback = V8ErrorCallback::create(args[3], getScriptExecutionContext());
     }
     imp->getFile(path, flags, successCallback, errorCallback);

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -78,7 +78,7 @@
 
     RefPtr<XPathNSResolver> resolver = V8DOMWrapper::getXPathNSResolver(args[2]);
     if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined())
-        return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+        return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
 
     int type = toInt32(args[3]);
     RefPtr<XPathResult> inResult;
@@ -91,7 +91,7 @@
         return throwError(exceptionCatcher.Exception(), args.GetIsolate());
 
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     return toV8(result.release(), args.GetIsolate());
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -81,7 +81,7 @@
     History* history = V8History::toNative(args.Holder());
     history->stateObjectAdded(historyState.release(), title, url, History::StateObjectPush, ec);
     args.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state());
-    return throwError(ec, args.GetIsolate());
+    return V8Proxy::setDOMException(ec, args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8History::replaceStateCallback(const v8::Arguments& args)
@@ -106,7 +106,7 @@
     History* history = V8History::toNative(args.Holder());
     history->stateObjectAdded(historyState.release(), title, url, History::StateObjectReplace, ec);
     args.Holder()->DeleteHiddenValue(V8HiddenPropertyName::state());
-    return throwError(ec, args.GetIsolate());
+    return V8Proxy::setDOMException(ec, args.GetIsolate());
 }
 
 bool V8History::indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -60,7 +60,7 @@
         ExceptionCode ec = 0;
         RefPtr<Intent> impl = Intent::create(ScriptState::current(), options, ec);
         if (ec)
-            return throwError(ec, args.GetIsolate());
+            return V8Proxy::setDOMException(ec, args.GetIsolate());
 
         v8::Handle<v8::Object> wrapper = args.Holder();
         V8DOMWrapper::setDOMWrapper(wrapper, &info, impl.get());
@@ -80,11 +80,11 @@
     bool dataDidThrow = false;
     RefPtr<SerializedScriptValue> data = "" &messagePortArrayTransferList, &arrayBufferArrayTransferList, dataDidThrow);
     if (dataDidThrow)
-        return throwError(DATA_CLONE_ERR, args.GetIsolate());
+        return V8Proxy::setDOMException(DATA_CLONE_ERR, args.GetIsolate());
 
     RefPtr<Intent> impl = Intent::create(action, type, data, messagePortArrayTransferList, ec);
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     v8::Handle<v8::Object> wrapper = args.Holder();
     V8DOMWrapper::setDOMWrapper(wrapper, &info, impl.get());

Modified: trunk/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -62,7 +62,7 @@
         return v8::Undefined();
     ExceptionCode ec = 0;
     messagePort->postMessage(message.release(), &portArray, ec);
-    return throwError(ec, args.GetIsolate());
+    return V8Proxy::setDOMException(ec, args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MutationObserverCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -59,7 +59,7 @@
 
     v8::Local<v8::Value> arg = args[0];
     if (!arg->IsObject())
-        return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+        return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
 
     ScriptExecutionContext* context = getScriptExecutionContext();
     if (!context)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -57,7 +57,7 @@
     RefPtr<Notification> notification = notificationCenter->createHTMLNotification(url, ec);
 
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     notification->ref();
     return toV8(notification.get(), args.GetIsolate());
@@ -72,7 +72,7 @@
     RefPtr<Notification> notification = notificationCenter->createNotification(toWebCoreString(args[0]), toWebCoreString(args[1]), toWebCoreString(args[2]), ec);
 
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     notification->ref();
     return toV8(notification.get(), args.GetIsolate());
@@ -86,11 +86,11 @@
 
     // Make sure that script execution context is valid.
     if (!context)
-        return throwError(INVALID_STATE_ERR, args.GetIsolate());
+        return V8Proxy::setDOMException(INVALID_STATE_ERR, args.GetIsolate());
 
     // Requesting permission is only valid from a page context.
     if (context->isWorkerContext())
-        return throwError(NOT_SUPPORTED_ERR, args.GetIsolate());
+        return V8Proxy::setDOMException(NOT_SUPPORTED_ERR, args.GetIsolate());
 
     RefPtr<V8CustomVoidCallback> callback;
     if (args.Length() > 0) {

Modified: trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -52,7 +52,7 @@
     INC_STATS("DOM.SQLTransaction.executeSql()");
 
     if (args.Length() == 0)
-        return throwError(SYNTAX_ERR, args.GetIsolate());
+        return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
 
     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, statement, args[0]);
 
@@ -60,7 +60,7 @@
 
     if (args.Length() > 1 && !isUndefinedOrNull(args[1])) {
         if (!args[1]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
 
         uint32_t sqlArgsLength = 0;
         v8::Local<v8::Object> sqlArgsObject = args[1]->ToObject();
@@ -96,14 +96,14 @@
     RefPtr<SQLStatementCallback> callback;
     if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
         if (!args[2]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
         callback = V8SQLStatementCallback::create(args[2], scriptExecutionContext);
     }
 
     RefPtr<SQLStatementErrorCallback> errorCallback;
     if (args.Length() > 3 && !isUndefinedOrNull(args[3])) {
         if (!args[3]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
         errorCallback = V8SQLStatementErrorCallback::create(args[3], scriptExecutionContext);
     }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -52,7 +52,7 @@
     INC_STATS("DOM.SQLTransactionSync.executeSql()");
 
     if (!args.Length())
-        return throwError(SYNTAX_ERR, args.GetIsolate());
+        return V8Proxy::setDOMException(SYNTAX_ERR, args.GetIsolate());
 
     STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, statement, args[0]);
 
@@ -60,7 +60,7 @@
 
     if (args.Length() > 1 && !isUndefinedOrNull(args[1])) {
         if (!args[1]->IsObject())
-            return throwError(TYPE_MISMATCH_ERR, args.GetIsolate());
+            return V8Proxy::setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
 
         uint32_t sqlArgsLength = 0;
         v8::Local<v8::Object> sqlArgsObject = args[1]->ToObject();

Modified: trunk/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8StorageCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -108,7 +108,7 @@
     ExceptionCode ec = 0;
     storage->setItem(name, value, ec);
     if (ec)
-        return throwError(ec, info.GetIsolate());
+        return V8Proxy::setDOMException(ec, info.GetIsolate());
 
     return v8Value;
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -106,7 +106,7 @@
         }
     }
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     v8::Handle<v8::Object> wrapper = args.Holder();
     V8DOMWrapper::setDOMWrapper(wrapper, &info, webSocket.get());
@@ -145,7 +145,7 @@
         result = webSocket->send(toWebCoreString(stringMessage), ec);
     }
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     return v8Boolean(result, args.GetIsolate());
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WorkerContextCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -106,7 +106,7 @@
     workerContext->importScripts(urls, ec);
 
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     return v8::Undefined();
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -68,7 +68,7 @@
         return v8::Undefined();
     ExceptionCode ec = 0;
     worker->postMessage(message.release(), &ports, ec);
-    return throwError(ec, args.GetIsolate());
+    return V8Proxy::setDOMException(ec, args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8Worker::postMessageCallback(const v8::Arguments& args)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp (124984 => 124985)


--- trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp	2012-08-08 05:02:35 UTC (rev 124984)
+++ trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp	2012-08-08 05:06:32 UTC (rev 124985)
@@ -57,7 +57,7 @@
     ExceptionCode ec = 0;
     const String& text = xmlHttpRequest->responseText(ec);
     if (ec)
-        return throwError(ec, info.GetIsolate());
+        return V8Proxy::setDOMException(ec, info.GetIsolate());
     return v8String(text, info.GetIsolate());
 }
 
@@ -143,7 +143,7 @@
         xmlHttpRequest->open(method, url, ec);
 
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     return v8::Undefined();
 }
@@ -200,7 +200,7 @@
     }
 
     if (ec)
-        return throwError(ec, args.GetIsolate());
+        return V8Proxy::setDOMException(ec, args.GetIsolate());
 
     return v8::Undefined();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to