Index: Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp |
diff --git a/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp b/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp |
index 8994365f8878950e09fbbe3434e2b09a9ff7d5a2..5ea4c74ff328729c16bfc840113f5f73d11a6685 100644 |
--- a/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp |
+++ b/Source/bindings/v8/custom/V8DedicatedWorkerGlobalScopeCustom.cpp |
@@ -47,10 +47,11 @@ void V8DedicatedWorkerGlobalScope::postMessageMethodCustom(const v8::FunctionCal |
MessagePortArray ports; |
ArrayBufferArray arrayBuffers; |
if (args.Length() > 1) { |
+ const int transferablesArgIndex = 1; |
bool notASequence = false; |
- if (!extractTransferables(args[1], ports, arrayBuffers, notASequence, args.GetIsolate())) { |
+ if (!extractTransferables(args[transferablesArgIndex], ports, arrayBuffers, notASequence, args.GetIsolate())) { |
if (notASequence) |
- throwTypeError(ExceptionMessages::failedToExecute("postMessage", "WorkerGlobalScope", ExceptionMessages::notASequenceType("Second")), args.GetIsolate()); |
+ throwTypeError(ExceptionMessages::failedToExecute("postMessage", "WorkerGlobalScope", ExceptionMessages::notASequenceTypeArgumentOrValue(transferablesArgIndex + 1)), args.GetIsolate()); |
return; |
} |
} |