Chromium Code Reviews| Index: Source/bindings/v8/custom/V8WindowCustom.cpp |
| diff --git a/Source/bindings/v8/custom/V8WindowCustom.cpp b/Source/bindings/v8/custom/V8WindowCustom.cpp |
| index 4260d3be5aaf37bca1c517c1c0876a7affd1974b..f16431404a0600350b9ff9642a510bc179a040ab 100644 |
| --- a/Source/bindings/v8/custom/V8WindowCustom.cpp |
| +++ b/Source/bindings/v8/custom/V8WindowCustom.cpp |
| @@ -34,6 +34,7 @@ |
| #include "V8HTMLCollection.h" |
| #include "V8Node.h" |
| #include "bindings/v8/BindingSecurity.h" |
| +#include "bindings/v8/ExceptionMessages.h" |
| #include "bindings/v8/ExceptionState.h" |
| #include "bindings/v8/ScheduledAction.h" |
| #include "bindings/v8/ScriptController.h" |
| @@ -262,8 +263,16 @@ void V8Window::postMessageMethodCustom(const v8::FunctionCallbackInfo<v8::Value> |
| targetOriginArgIndex = 2; |
| transferablesArgIndex = 1; |
| } |
| - if (!extractTransferables(args[transferablesArgIndex], portArray, arrayBufferArray, args.GetIsolate())) |
| + bool notASequence = false; |
| + if (!extractTransferables( |
| + args[transferablesArgIndex], portArray, arrayBufferArray, notASequence, args.GetIsolate())) { |
|
Mike West
2013/10/22 06:50:40
Nit: line breaks.
|
| + if (notASequence) { |
| + String failedArgument = transferablesArgIndex == 1 ? "Second" : "Third"; |
| + throwTypeError(ExceptionMessages::failedToExecute( |
|
Mike West
2013/10/22 06:50:40
Nit: line breaks. (If you were feeling particularl
|
| + "postMessage", "Window", ExceptionMessages::notASequenceType(failedArgument)), args.GetIsolate()); |
| + } |
| return; |
| + } |
| } |
| V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, targetOrigin, args[targetOriginArgIndex]); |