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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp

Issue 349523004: IDL: Generate all constructor callbacks with the same template macro (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix arity check Created 6 years, 5 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 "V8TestInterfaceNamedConstructor.h" 8 #include "V8TestInterfaceNamedConstructor.h"
9 9
10 #include "bindings/v8/ExceptionState.h" 10 #include "bindings/v8/ExceptionState.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 v8::Isolate* isolate = info.GetIsolate(); 77 v8::Isolate* isolate = info.GetIsolate();
78 if (!info.IsConstructCall()) { 78 if (!info.IsConstructCall()) {
79 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Audi o"), isolate); 79 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Audi o"), isolate);
80 return; 80 return;
81 } 81 }
82 82
83 if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject ) { 83 if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject ) {
84 v8SetReturnValue(info, info.Holder()); 84 v8SetReturnValue(info, info.Holder());
85 return; 85 return;
86 } 86 }
87
88 Document& document = *toDocument(currentExecutionContext(isolate));
89
90 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceNamedConstructor", info.Holder(), isolate); 87 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceNamedConstructor", info.Holder(), isolate);
91 if (UNLIKELY(info.Length() < 1)) { 88 if (UNLIKELY(info.Length() < 1)) {
92 throwMinimumArityTypeError(exceptionState, 1, info.Length()); 89 throwMinimumArityTypeError(exceptionState, 1, info.Length());
93 return; 90 return;
94 } 91 }
95 V8StringResource<> stringArg; 92 V8StringResource<> stringArg;
96 bool defaultUndefinedOptionalBooleanArg; 93 bool defaultUndefinedOptionalBooleanArg;
97 int defaultUndefinedOptionalLongArg; 94 int defaultUndefinedOptionalLongArg;
98 V8StringResource<> defaultUndefinedOptionalStringArg; 95 V8StringResource<> defaultUndefinedOptionalStringArg;
99 V8StringResource<> defaultNullStringOptionalstringArg; 96 V8StringResource<> defaultNullStringOptionalstringArg;
(...skipping 12 matching lines...) Expand all
112 } 109 }
113 if (UNLIKELY(info.Length() <= 5)) { 110 if (UNLIKELY(info.Length() <= 5)) {
114 RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConst ructor::createForJSConstructor(document, stringArg, defaultUndefinedOptionalBool eanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defa ultNullStringOptionalstringArg, exceptionState); 111 RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConst ructor::createForJSConstructor(document, stringArg, defaultUndefinedOptionalBool eanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defa ultNullStringOptionalstringArg, exceptionState);
115 v8::Handle<v8::Object> wrapper = info.Holder(); 112 v8::Handle<v8::Object> wrapper = info.Holder();
116 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstru ctor>(impl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeIn fo, wrapper, isolate, WrapperConfiguration::Dependent); 113 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstru ctor>(impl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeIn fo, wrapper, isolate, WrapperConfiguration::Dependent);
117 v8SetReturnValue(info, wrapper); 114 v8SetReturnValue(info, wrapper);
118 return; 115 return;
119 } 116 }
120 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]); 117 TOSTRING_VOID_INTERNAL(optionalStringArg, info[5]);
121 } 118 }
119 Document& document = *toDocument(currentExecutionContext(isolate));
122 RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor:: createForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullS tringOptionalstringArg, optionalStringArg, exceptionState); 120 RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor:: createForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullS tringOptionalstringArg, optionalStringArg, exceptionState);
123 if (exceptionState.throwIfNeeded()) 121 if (exceptionState.throwIfNeeded())
124 return; 122 return;
125 123
126 v8::Handle<v8::Object> wrapper = info.Holder(); 124 v8::Handle<v8::Object> wrapper = info.Holder();
127 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(im pl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrap per, isolate, WrapperConfiguration::Dependent); 125 V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(im pl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrap per, isolate, WrapperConfiguration::Dependent);
128 v8SetReturnValue(info, wrapper); 126 v8SetReturnValue(info, wrapper);
129 } 127 }
130 128
131 v8::Handle<v8::FunctionTemplate> V8TestInterfaceNamedConstructorConstructor::dom Template(v8::Isolate* isolate) 129 v8::Handle<v8::FunctionTemplate> V8TestInterfaceNamedConstructorConstructor::dom Template(v8::Isolate* isolate)
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 fromInternalPointer(object)->deref(); 218 fromInternalPointer(object)->deref();
221 } 219 }
222 220
223 template<> 221 template<>
224 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate) 222 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate)
225 { 223 {
226 return toV8(impl, creationContext, isolate); 224 return toV8(impl, creationContext, isolate);
227 } 225 }
228 226
229 } // namespace WebCore 227 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698