Index: Source/bindings/v8/custom/V8MessagePortCustom.cpp |
diff --git a/Source/bindings/v8/custom/V8MessagePortCustom.cpp b/Source/bindings/v8/custom/V8MessagePortCustom.cpp |
index c35b1d86beb2617164ce576d04c3ed01d9bfbfbc..f8eb9df2abdcfe5bbfb05a53b8a648c7aaec5d4d 100644 |
--- a/Source/bindings/v8/custom/V8MessagePortCustom.cpp |
+++ b/Source/bindings/v8/custom/V8MessagePortCustom.cpp |
@@ -43,6 +43,7 @@ namespace WebCore { |
void V8MessagePort::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", "MessagePort", info.Holder(), info.GetIsolate()); |
MessagePort* messagePort = V8MessagePort::toNative(info.Holder()); |
MessagePortArray portArray; |
ArrayBufferArray arrayBufferArray; |
@@ -50,8 +51,10 @@ void V8MessagePort::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::V |
bool notASequence = false; |
const int transferablesArgIndex = 1; |
if (!extractTransferables(info[transferablesArgIndex], portArray, arrayBufferArray, notASequence, info.GetIsolate())) { |
- if (notASequence) |
- throwTypeError(ExceptionMessages::failedToExecute("postMessage", "MessagePort", ExceptionMessages::notAnArrayTypeArgumentOrValue(transferablesArgIndex + 1)), info.GetIsolate()); |
+ if (notASequence) { |
+ exceptionState.throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(transferablesArgIndex + 1)); |
+ exceptionState.throwIfNeeded(); |
+ } |
return; |
} |
} |
@@ -59,7 +62,6 @@ void V8MessagePort::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::V |
RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(info[0], &portArray, &arrayBufferArray, didThrow, info.GetIsolate()); |
if (didThrow) |
return; |
- ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
messagePort->postMessage(message.release(), &portArray, exceptionState); |
exceptionState.throwIfNeeded(); |
} |