Chromium Code Reviews| Index: Source/bindings/v8/custom/V8MessagePortCustom.cpp |
| diff --git a/Source/bindings/v8/custom/V8MessagePortCustom.cpp b/Source/bindings/v8/custom/V8MessagePortCustom.cpp |
| index cedf23f3274ff44d92382051c786a3a1ce722334..551df9c3215bd854fe7c9c24b45e14e16bf4a988 100644 |
| --- a/Source/bindings/v8/custom/V8MessagePortCustom.cpp |
| +++ b/Source/bindings/v8/custom/V8MessagePortCustom.cpp |
| @@ -31,6 +31,7 @@ |
| #include "config.h" |
| #include "V8MessagePort.h" |
| +#include "bindings/v8/ExceptionMessages.h" |
| #include "bindings/v8/ExceptionState.h" |
| #include "bindings/v8/SerializedScriptValue.h" |
| #include "bindings/v8/V8Binding.h" |
| @@ -46,8 +47,15 @@ void V8MessagePort::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::V |
| MessagePortArray portArray; |
| ArrayBufferArray arrayBufferArray; |
| if (args.Length() > 1) { |
| - if (!extractTransferables(args[1], portArray, arrayBufferArray, args.GetIsolate())) |
| + bool notASequence = false; |
| + if (!extractTransferables( |
| + args[1], portArray, arrayBufferArray, notASequence, args.GetIsolate())) { |
|
Mike West
2013/10/22 06:50:40
Nit: line breaks.
|
| + if (notASequence) { |
| + throwTypeError(ExceptionMessages::failedToExecute( |
|
Mike West
2013/10/22 06:50:40
Nit: line breaks.
|
| + "postMessage", "MessagePort", ExceptionMessages::notASequenceType("Second")), args.GetIsolate()); |
| + } |
| return; |
| + } |
| } |
| bool didThrow = false; |
| RefPtr<SerializedScriptValue> message = |