Chromium Code Reviews| Index: Source/bindings/v8/V8ThrowException.cpp |
| diff --git a/Source/bindings/v8/V8ThrowException.cpp b/Source/bindings/v8/V8ThrowException.cpp |
| index 553310860d9d4566cd001ccc009b4b60c1b9d084..6b0ff9e78fa24d198d2d79f6fe1ad067bed9970d 100644 |
| --- a/Source/bindings/v8/V8ThrowException.cpp |
| +++ b/Source/bindings/v8/V8ThrowException.cpp |
| @@ -44,16 +44,19 @@ static void domExceptionStackSetter(v8::Local<v8::String> name, v8::Local<v8::Va |
| info.Data()->ToObject()->Set(v8::String::NewSymbol("stack"), value); |
| } |
| -v8::Handle<v8::Value> V8ThrowException::createDOMException(int ec, const String& message, v8::Isolate* isolate) |
| +v8::Handle<v8::Value> V8ThrowException::createDOMException(int ec, const String& sanitizedMessage, const String& unsanitizedMessage, v8::Isolate* isolate) |
| { |
| if (ec <= 0 || v8::V8::IsExecutionTerminating()) |
| return v8Undefined(); |
| // FIXME: Handle other WebIDL exception types. |
| - if (ec == TypeError) |
| - return V8ThrowException::createTypeError(message, isolate); |
| + if (ec == TypeError) { |
| + // Unsanitized messages are only relevant for SecurityError exceptions. |
|
arv (Not doing code reviews)
2013/08/14 13:43:03
Maybe add an assert outside this if.
ASSERT(ec ==
Use mkwst_at_chromium.org plz.
2013/08/14 13:57:21
Done.
|
| + ASSERT(unsanitizedMessage.isEmpty()); |
| + return V8ThrowException::createTypeError(sanitizedMessage, isolate); |
| + } |
| - RefPtr<DOMException> domException = DOMException::create(ec, message); |
| + RefPtr<DOMException> domException = DOMException::create(ec, sanitizedMessage, unsanitizedMessage); |
| v8::Handle<v8::Value> exception = toV8(domException, v8::Handle<v8::Object>(), isolate); |
| if (exception.IsEmpty()) |
| @@ -68,9 +71,9 @@ v8::Handle<v8::Value> V8ThrowException::createDOMException(int ec, const String& |
| return exception; |
| } |
| -v8::Handle<v8::Value> V8ThrowException::throwDOMException(int ec, const String& message, v8::Isolate* isolate) |
| +v8::Handle<v8::Value> V8ThrowException::throwDOMException(int ec, const String& sanitizedMessage, const String& unsanitizedMessage, v8::Isolate* isolate) |
| { |
| - v8::Handle<v8::Value> exception = createDOMException(ec, message, isolate); |
| + v8::Handle<v8::Value> exception = createDOMException(ec, sanitizedMessage, unsanitizedMessage, isolate); |
|
arv (Not doing code reviews)
2013/08/14 13:43:03
Assert here too?
Use mkwst_at_chromium.org plz.
2013/08/14 13:57:21
Done.
|
| if (exception.IsEmpty()) |
| return v8Undefined(); |