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

Unified Diff: Source/bindings/tests/results/V8TestInterfaceConstructor.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, 6 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
Index: Source/bindings/tests/results/V8TestInterfaceConstructor.cpp
diff --git a/Source/bindings/tests/results/V8TestInterfaceConstructor.cpp b/Source/bindings/tests/results/V8TestInterfaceConstructor.cpp
index 163291c2fcf623ca326e127ef9ea70943fe4aefc..5adf3f7cc743144aa3a2f3e7f1b5802efb6d7a3a 100644
--- a/Source/bindings/tests/results/V8TestInterfaceConstructor.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceConstructor.cpp
@@ -72,6 +72,7 @@ static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
Vector<String> sequenceStringArg;
Vector<Dictionary> sequenceDictionaryArg;
Dictionary optionalDictionaryArg;
+ bool optionalDictionaryArgMissing = false;
Jens Widell 2014/06/17 09:53:37 The code generated here is not correct; this new l
TestInterfaceEmpty* optionalTestInterfaceEmptyArg;
{
v8::TryCatch block;
@@ -87,11 +88,15 @@ static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info)
}
TONATIVE_VOID_INTERNAL(sequenceStringArg, toNativeArray<String>(info[4], 5, info.GetIsolate()));
TONATIVE_VOID_INTERNAL(sequenceDictionaryArg, toNativeArray<Dictionary>(info[5], 6, info.GetIsolate()));
- TONATIVE_VOID_INTERNAL(optionalDictionaryArg, Dictionary(info[6], info.GetIsolate()));
- if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isObject()) {
- exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object.");
- exceptionState.throwIfNeeded();
- return;
+ if (info.Length() > 6) {
+ TONATIVE_VOID_INTERNAL(optionalDictionaryArg, Dictionary(info[6], info.GetIsolate()));
+ if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg.isObject()) {
+ exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object.");
+ exceptionState.throwIfNeeded();
+ return;
+ }
+ } else {
+ optionalDictionaryArgMissing = true;
}
TONATIVE_VOID_INTERNAL(optionalTestInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[7]));
}

Powered by Google App Engine
This is Rietveld 408576698