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

Unified Diff: Source/bindings/core/v8/SerializedScriptValue.cpp

Issue 1022283002: Throw TypeError if value conversion to transferable fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add more tests for TypeError throwing Created 5 years, 9 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 | « LayoutTests/fast/workers/worker-multi-port-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/SerializedScriptValue.cpp
diff --git a/Source/bindings/core/v8/SerializedScriptValue.cpp b/Source/bindings/core/v8/SerializedScriptValue.cpp
index ffbac584985abd864649160a08f367f9dd24f867..9407f26d24861414c027e169c41e0d3f8d164b5a 100644
--- a/Source/bindings/core/v8/SerializedScriptValue.cpp
+++ b/Source/bindings/core/v8/SerializedScriptValue.cpp
@@ -183,7 +183,7 @@ bool SerializedScriptValue::extractTransferables(v8::Isolate* isolate, v8::Local
v8::Local<v8::Value> transferrable = transferrables->Get(i);
// Validation of non-null objects, per HTML5 spec 10.3.3.
if (isUndefinedOrNull(transferrable)) {
- exceptionState.throwDOMException(DataCloneError, "Value at index " + String::number(i) + " is an untransferable " + (transferrable->IsUndefined() ? "'undefined'" : "'null'") + " value.");
+ exceptionState.throwTypeError("Value at index " + String::number(i) + " is an untransferable " + (transferrable->IsUndefined() ? "'undefined'" : "'null'") + " value.");
return false;
}
// Validation of Objects implementing an interface, per WebIDL spec 4.1.15.
@@ -203,7 +203,7 @@ bool SerializedScriptValue::extractTransferables(v8::Isolate* isolate, v8::Local
}
arrayBuffers.append(arrayBuffer.release());
} else {
- exceptionState.throwDOMException(DataCloneError, "Value at index " + String::number(i) + " does not have a transferable type.");
+ exceptionState.throwTypeError("Value at index " + String::number(i) + " does not have a transferable type.");
return false;
}
}
« no previous file with comments | « LayoutTests/fast/workers/worker-multi-port-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698