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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterfaceConstructor.h" 8 #include "V8TestInterfaceConstructor.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 { 65 {
66 v8::Isolate* isolate = info.GetIsolate(); 66 v8::Isolate* isolate = info.GetIsolate();
67 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), isolate); 67 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), isolate);
68 double doubleArg; 68 double doubleArg;
69 V8StringResource<> stringArg; 69 V8StringResource<> stringArg;
70 TestInterfaceEmpty* testInterfaceEmptyArg; 70 TestInterfaceEmpty* testInterfaceEmptyArg;
71 Dictionary dictionaryArg; 71 Dictionary dictionaryArg;
72 Vector<String> sequenceStringArg; 72 Vector<String> sequenceStringArg;
73 Vector<Dictionary> sequenceDictionaryArg; 73 Vector<Dictionary> sequenceDictionaryArg;
74 Dictionary optionalDictionaryArg; 74 Dictionary optionalDictionaryArg;
75 bool optionalDictionaryArgMissing = false;
Jens Widell 2014/06/17 09:53:37 The code generated here is not correct; this new l
75 TestInterfaceEmpty* optionalTestInterfaceEmptyArg; 76 TestInterfaceEmpty* optionalTestInterfaceEmptyArg;
76 { 77 {
77 v8::TryCatch block; 78 v8::TryCatch block;
78 V8RethrowTryCatchScope rethrow(block); 79 V8RethrowTryCatchScope rethrow(block);
79 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberVal ue())); 80 TONATIVE_VOID_INTERNAL(doubleArg, static_cast<double>(info[0]->NumberVal ue()));
80 TOSTRING_VOID_INTERNAL(stringArg, info[1]); 81 TOSTRING_VOID_INTERNAL(stringArg, info[1]);
81 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNa tiveWithTypeCheck(info.GetIsolate(), info[2])); 82 TONATIVE_VOID_INTERNAL(testInterfaceEmptyArg, V8TestInterfaceEmpty::toNa tiveWithTypeCheck(info.GetIsolate(), info[2]));
82 TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[3], info.GetIsolat e())); 83 TONATIVE_VOID_INTERNAL(dictionaryArg, Dictionary(info[3], info.GetIsolat e()));
83 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) { 84 if (!dictionaryArg.isUndefinedOrNull() && !dictionaryArg.isObject()) {
84 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an object."); 85 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an object.");
85 exceptionState.throwIfNeeded(); 86 exceptionState.throwIfNeeded();
86 return; 87 return;
87 } 88 }
88 TONATIVE_VOID_INTERNAL(sequenceStringArg, toNativeArray<String>(info[4], 5, info.GetIsolate())); 89 TONATIVE_VOID_INTERNAL(sequenceStringArg, toNativeArray<String>(info[4], 5, info.GetIsolate()));
89 TONATIVE_VOID_INTERNAL(sequenceDictionaryArg, toNativeArray<Dictionary>( info[5], 6, info.GetIsolate())); 90 TONATIVE_VOID_INTERNAL(sequenceDictionaryArg, toNativeArray<Dictionary>( info[5], 6, info.GetIsolate()));
90 TONATIVE_VOID_INTERNAL(optionalDictionaryArg, Dictionary(info[6], info.G etIsolate())); 91 if (info.Length() > 6) {
91 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionaryArg .isObject()) { 92 TONATIVE_VOID_INTERNAL(optionalDictionaryArg, Dictionary(info[6], in fo.GetIsolate()));
92 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryArg') is not an object."); 93 if (!optionalDictionaryArg.isUndefinedOrNull() && !optionalDictionar yArg.isObject()) {
93 exceptionState.throwIfNeeded(); 94 exceptionState.throwTypeError("parameter 7 ('optionalDictionaryA rg') is not an object.");
94 return; 95 exceptionState.throwIfNeeded();
96 return;
97 }
98 } else {
99 optionalDictionaryArgMissing = true;
95 } 100 }
96 TONATIVE_VOID_INTERNAL(optionalTestInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[7])); 101 TONATIVE_VOID_INTERNAL(optionalTestInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[7]));
97 } 102 }
98 ExecutionContext* context = currentExecutionContext(isolate); 103 ExecutionContext* context = currentExecutionContext(isolate);
99 Document& document = *toDocument(currentExecutionContext(isolate)); 104 Document& document = *toDocument(currentExecutionContext(isolate));
100 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ enceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTestInterfa ceEmptyArg, exceptionState); 105 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(con text, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionaryArg, sequ enceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTestInterfa ceEmptyArg, exceptionState);
101 if (exceptionState.throwIfNeeded()) 106 if (exceptionState.throwIfNeeded())
102 return; 107 return;
103 108
104 v8::Handle<v8::Object> wrapper = info.Holder(); 109 v8::Handle<v8::Object> wrapper = info.Holder();
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 fromInternalPointer(object)->deref(); 243 fromInternalPointer(object)->deref();
239 } 244 }
240 245
241 template<> 246 template<>
242 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 247 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
243 { 248 {
244 return toV8(impl, creationContext, isolate); 249 return toV8(impl, creationContext, isolate);
245 } 250 }
246 251
247 } // namespace WebCore 252 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698