Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: Source/bindings/v8/custom/V8WindowCustom.cpp

Issue 30673002: More informative error messages for non-Transferables. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More informative error messages for non-Transferables. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/custom/V8MessagePortCustom.cpp ('k') | Source/bindings/v8/custom/V8WorkerCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f12a12b93d53d647225db9eb5ad3ad77e653db12 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,12 @@ 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())) {
+ if (notASequence)
+ throwTypeError(ExceptionMessages::failedToExecute("postMessage", "Window", ExceptionMessages::notASequenceType(transferablesArgIndex == 1 ? "Second" : "Third")), args.GetIsolate());
return;
+ }
}
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, targetOrigin, args[targetOriginArgIndex]);
« no previous file with comments | « Source/bindings/v8/custom/V8MessagePortCustom.cpp ('k') | Source/bindings/v8/custom/V8WorkerCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698