Title: [114919] trunk/Source/WebCore
- Revision
- 114919
- Author
- hara...@chromium.org
- Date
- 2012-04-23 10:47:54 -0700 (Mon, 23 Apr 2012)
Log Message
[V8] Add an optional Isolate argument to setDOMException() and throwError()
https://bugs.webkit.org/show_bug.cgi?id=84310
Reviewed by Nate Chapin.
The objective is to pass Isolate to setDOMException()
and throwError(). This patch adds an optional Isolate argument
to setDOMException() and throwError(). I'll pass the Isolate
to these methods in the following patches.
No tests. No change in behavior.
* bindings/v8/V8Proxy.cpp:
(WebCore):
(WebCore::V8Proxy::setDOMException):
(WebCore::V8Proxy::throwError):
* bindings/v8/V8Proxy.h:
(V8Proxy):
(WebCore):
(WebCore::throwError):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (114918 => 114919)
--- trunk/Source/WebCore/ChangeLog 2012-04-23 17:42:19 UTC (rev 114918)
+++ trunk/Source/WebCore/ChangeLog 2012-04-23 17:47:54 UTC (rev 114919)
@@ -1,3 +1,26 @@
+2012-04-23 Kentaro Hara <hara...@chromium.org>
+
+ [V8] Add an optional Isolate argument to setDOMException() and throwError()
+ https://bugs.webkit.org/show_bug.cgi?id=84310
+
+ Reviewed by Nate Chapin.
+
+ The objective is to pass Isolate to setDOMException()
+ and throwError(). This patch adds an optional Isolate argument
+ to setDOMException() and throwError(). I'll pass the Isolate
+ to these methods in the following patches.
+
+ No tests. No change in behavior.
+
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore):
+ (WebCore::V8Proxy::setDOMException):
+ (WebCore::V8Proxy::throwError):
+ * bindings/v8/V8Proxy.h:
+ (V8Proxy):
+ (WebCore):
+ (WebCore::throwError):
+
2012-04-23 Ian Vollick <voll...@chromium.org>
[chromium] Properly ignore unsupported animation directions.
Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.cpp (114918 => 114919)
--- trunk/Source/WebCore/bindings/v8/V8Proxy.cpp 2012-04-23 17:42:19 UTC (rev 114918)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.cpp 2012-04-23 17:47:54 UTC (rev 114919)
@@ -542,10 +542,10 @@
#define TRY_TO_CREATE_EXCEPTION(interfaceName) \
case interfaceName##Type: \
- exception = toV8(interfaceName::create(description)); \
+ exception = toV8(interfaceName::create(description), isolate); \
break;
-void V8Proxy::setDOMException(int ec)
+void V8Proxy::setDOMException(int ec, v8::Isolate* isolate)
{
if (ec <= 0)
return;
@@ -563,19 +563,19 @@
#undef TRY_TO_CREATE_EXCEPTION
-v8::Handle<v8::Value> V8Proxy::throwError(ErrorType type, const char* message)
+v8::Handle<v8::Value> V8Proxy::throwError(ErrorType type, const char* message, v8::Isolate* isolate)
{
switch (type) {
case RangeError:
- return v8::ThrowException(v8::Exception::RangeError(v8String(message)));
+ return v8::ThrowException(v8::Exception::RangeError(v8String(message, isolate)));
case ReferenceError:
- return v8::ThrowException(v8::Exception::ReferenceError(v8String(message)));
+ return v8::ThrowException(v8::Exception::ReferenceError(v8String(message, isolate)));
case SyntaxError:
- return v8::ThrowException(v8::Exception::SyntaxError(v8String(message)));
+ return v8::ThrowException(v8::Exception::SyntaxError(v8String(message, isolate)));
case TypeError:
- return v8::ThrowException(v8::Exception::TypeError(v8String(message)));
+ return v8::ThrowException(v8::Exception::TypeError(v8String(message, isolate)));
case GeneralError:
- return v8::ThrowException(v8::Exception::Error(v8String(message)));
+ return v8::ThrowException(v8::Exception::Error(v8String(message, isolate)));
default:
ASSERT_NOT_REACHED();
return notHandledByInterceptor();
Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.h (114918 => 114919)
--- trunk/Source/WebCore/bindings/v8/V8Proxy.h 2012-04-23 17:42:19 UTC (rev 114918)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.h 2012-04-23 17:47:54 UTC (rev 114919)
@@ -235,10 +235,10 @@
// If the exception code is different from zero, a DOM exception is
// schedule to be thrown.
- static void setDOMException(int exceptionCode);
+ static void setDOMException(int exceptionCode, v8::Isolate* = 0);
// Schedule an error object to be thrown.
- static v8::Handle<v8::Value> throwError(ErrorType, const char* message);
+ static v8::Handle<v8::Value> throwError(ErrorType, const char* message, v8::Isolate* = 0);
// Helpers for throwing syntax and type errors with predefined messages.
static v8::Handle<v8::Value> throwTypeError();
@@ -324,23 +324,31 @@
{
return v8::Local<v8::Boolean>();
}
- inline v8::Handle<v8::Primitive> throwError(const char* message, V8Proxy::ErrorType type = V8Proxy::TypeError)
+
+ inline v8::Handle<v8::Primitive> throwError(const char* message, v8::Isolate* isolate = 0)
{
if (!v8::V8::IsExecutionTerminating())
- V8Proxy::throwError(type, message);
+ V8Proxy::throwError(V8Proxy::TypeError, message, isolate);
return v8::Undefined();
}
- inline v8::Handle<v8::Primitive> throwError(ExceptionCode ec)
+ inline v8::Handle<v8::Primitive> throwError(const char* message, V8Proxy::ErrorType type, v8::Isolate* isolate = 0)
{
if (!v8::V8::IsExecutionTerminating())
- V8Proxy::setDOMException(ec);
+ V8Proxy::throwError(type, message, isolate);
return v8::Undefined();
}
- inline v8::Handle<v8::Primitive> throwError(v8::Local<v8::Value> exception)
+ inline v8::Handle<v8::Primitive> throwError(ExceptionCode ec, v8::Isolate* isolate = 0)
{
if (!v8::V8::IsExecutionTerminating())
+ V8Proxy::setDOMException(ec, isolate);
+ return v8::Undefined();
+ }
+
+ inline v8::Handle<v8::Primitive> throwError(v8::Local<v8::Value> exception, v8::Isolate* isolate = 0)
+ {
+ if (!v8::V8::IsExecutionTerminating())
v8::ThrowException(exception);
return v8::Undefined();
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes