Index: Source/bindings/core/v8/PostMessage.h |
diff --git a/Source/bindings/core/v8/PostMessage.h b/Source/bindings/core/v8/PostMessage.h |
index b4a381d35c5d9d723da24232182196634aabdd0e..b86a45c96a21aa340f198d4faeae8987bb13b495 100644 |
--- a/Source/bindings/core/v8/PostMessage.h |
+++ b/Source/bindings/core/v8/PostMessage.h |
@@ -23,6 +23,11 @@ template <class Type> |
void postMessageMethodCommon(const char* interfaceName, Type* instance, const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage", interfaceName, info.Holder(), info.GetIsolate()); |
+ if (UNLIKELY(info.Length() < 1)) { |
+ setMinimumArityTypeError(exceptionState, 1, info.Length()); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
MessagePortArray ports; |
ArrayBufferArray arrayBuffers; |
if (info.Length() > 1) { |