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

Unified Diff: Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.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/V8Utilities.cpp ('k') | Source/bindings/v8/custom/V8MessagePortCustom.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
diff --git a/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp b/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
index ffa25a147a0b9f0e3bbc5aef81f5d19e157e8cbb..8994365f8878950e09fbbe3434e2b09a9ff7d5a2 100644
--- a/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
+++ b/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "V8DedicatedWorkerGlobalScope.h"
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8Utilities.h"
@@ -46,8 +47,12 @@ void V8DedicatedWorkerGlobalScope::postMessageMethodCustom(const v8::FunctionCal
MessagePortArray ports;
ArrayBufferArray arrayBuffers;
if (args.Length() > 1) {
- if (!extractTransferables(args[1], ports, arrayBuffers, args.GetIsolate()))
+ bool notASequence = false;
+ if (!extractTransferables(args[1], ports, arrayBuffers, notASequence, args.GetIsolate())) {
+ if (notASequence)
+ throwTypeError(ExceptionMessages::failedToExecute("postMessage", "WorkerGlobalScope", ExceptionMessages::notASequenceType("Second")), args.GetIsolate());
return;
+ }
}
bool didThrow = false;
RefPtr<SerializedScriptValue> message =
« no previous file with comments | « Source/bindings/v8/V8Utilities.cpp ('k') | Source/bindings/v8/custom/V8MessagePortCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698