Index: Source/bindings/tests/results/core/V8TestObject.cpp |
diff --git a/Source/bindings/tests/results/core/V8TestObject.cpp b/Source/bindings/tests/results/core/V8TestObject.cpp |
index 535c45fe8c1abcbae000999c6d2d3c1c9ad48911..cf1509c1b1a1c81a85fb0a6d7e9b5132cc4f8d11 100644 |
--- a/Source/bindings/tests/results/core/V8TestObject.cpp |
+++ b/Source/bindings/tests/results/core/V8TestObject.cpp |
@@ -6662,12 +6662,22 @@ static void voidMethodArrayBufferOrNullArgMethodCallback(const v8::FunctionCallb |
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
} |
-static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+static void voidMethodArrayBufferViewArg1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
- if (UNLIKELY(info.Length() < 1)) { |
- V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodArrayBufferViewArg", "TestObject", 1, info.Length()), info.GetIsolate()); |
- return; |
+ TestObject* impl = V8TestObject::toImpl(info.Holder()); |
+ std::pair<void*, size_t> arrayBufferViewArg; |
+ { |
+ arrayBufferViewArg = info[0]->IsArrayBufferView() ? arrayBufferViewArg = std::make_pair(alloca(v8::ArrayBufferView::Cast(*info[0])->ByteLength()), v8::ArrayBufferView::Cast(*info[0])->ByteLength()), v8::ArrayBufferView::Cast(*info[0])->CopyContents(arrayBufferViewArg.first, arrayBufferViewArg.second), arrayBufferViewArg : std::make_pair(nullptr, 0); |
+ if (!arrayBufferViewArg.first) { |
+ V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodArrayBufferViewArg", "TestObject", "parameter 1 is not of type 'ArrayBufferView' and 'small'.")); |
+ return; |
+ } |
} |
+ impl->voidMethodArrayBufferViewArg(arrayBufferViewArg.first, arrayBufferViewArg.second); |
+} |
+ |
+static void voidMethodArrayBufferViewArg2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
TestObject* impl = V8TestObject::toImpl(info.Holder()); |
TestArrayBufferView* arrayBufferViewArg; |
{ |
@@ -6676,6 +6686,33 @@ static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8 |
impl->voidMethodArrayBufferViewArg(arrayBufferViewArg); |
} |
+static void voidMethodArrayBufferViewArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
+{ |
+ ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodArrayBufferViewArg", "TestObject", info.Holder(), info.GetIsolate()); |
+ switch (std::min(1, info.Length())) { |
+ case 1: |
+ if (V8ArrayBufferView::hasInstance(info[0], info.GetIsolate()) && !v8::ArrayBufferView::Cast(*info[0])->HasBuffer()) { |
+ voidMethodArrayBufferViewArg1Method(info); |
+ return; |
+ } |
+ if (V8ArrayBufferView::hasInstance(info[0], info.GetIsolate())) { |
+ voidMethodArrayBufferViewArg2Method(info); |
+ return; |
+ } |
+ break; |
+ default: |
+ break; |
+ } |
+ if (info.Length() < 1) { |
+ exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length())); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+ } |
+ exceptionState.throwTypeError("No function was found that matched the signature provided."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
+} |
+ |
static void voidMethodArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) |
{ |
TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |