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

Unified Diff: Source/bindings/tests/results/V8TestTypedefs.cpp

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 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/tests/results/V8TestObject.cpp ('k') | Source/core/css/CSSKeyframesRule.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestTypedefs.cpp
diff --git a/Source/bindings/tests/results/V8TestTypedefs.cpp b/Source/bindings/tests/results/V8TestTypedefs.cpp
index 68ae81945e895ec8c0ed50ccf1e8181b151fe4ff..d67786e854128070c146e5b874e64cce6f201784 100644
--- a/Source/bindings/tests/results/V8TestTypedefs.cpp
+++ b/Source/bindings/tests/results/V8TestTypedefs.cpp
@@ -8,6 +8,7 @@
#include "V8TestTypedefs.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/Optional.h"
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8HiddenValue.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
@@ -101,16 +102,17 @@ static void voidMethodArrayOfLongsArgMethod(const v8::FunctionCallbackInfo<v8::V
{
TestTypedefs* impl = V8TestTypedefs::toNative(info.Holder());
Vector<int> arrayOfLongsArg;
+ bool arrayOfLongsArgMissing = false;
{
v8::TryCatch block;
V8RethrowTryCatchScope rethrow(block);
- if (UNLIKELY(info.Length() <= 0)) {
- impl->voidMethodArrayOfLongsArg();
- return;
+ if (!info[0]->IsUndefined()) {
+ TONATIVE_VOID_INTERNAL(arrayOfLongsArg, toNativeArray<int>(info[0], 1, info.GetIsolate()));
+ } else {
+ arrayOfLongsArgMissing = true;
}
- TONATIVE_VOID_INTERNAL(arrayOfLongsArg, toNativeArray<int>(info[0], 1, info.GetIsolate()));
}
- impl->voidMethodArrayOfLongsArg(arrayOfLongsArg);
+ impl->voidMethodArrayOfLongsArg(Optional<Vector<int> >(arrayOfLongsArg, arrayOfLongsArgMissing));
}
static void voidMethodArrayOfLongsArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/core/css/CSSKeyframesRule.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698