| OLD | NEW |
| 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 "V8TestInterfaceConstructor2.h" | 7 #include "V8TestInterfaceConstructor2.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/Dictionary.h" | 9 #include "bindings/core/v8/Dictionary.h" |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 v8SetReturnValue(info, wrapper); | 63 v8SetReturnValue(info, wrapper); |
| 64 } | 64 } |
| 65 | 65 |
| 66 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) | 66 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 67 { | 67 { |
| 68 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); | 68 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); |
| 69 Dictionary dictionaryArg; | 69 Dictionary dictionaryArg; |
| 70 { | 70 { |
| 71 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { | 71 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { |
| 72 exceptionState.throwTypeError("parameter 1 ('dictionaryArg') is not
an object."); | 72 exceptionState.throwTypeError("parameter 1 ('dictionaryArg') is not
an object."); |
| 73 exceptionState.throwIfNeeded(); | |
| 74 return; | 73 return; |
| 75 } | 74 } |
| 76 dictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState); | 75 dictionaryArg = Dictionary(info[0], info.GetIsolate(), exceptionState); |
| 77 if (exceptionState.throwIfNeeded()) | 76 if (exceptionState.hadException()) |
| 78 return; | 77 return; |
| 79 } | 78 } |
| 80 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(dictiona
ryArg); | 79 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(dictiona
ryArg); |
| 81 v8::Local<v8::Object> wrapper = info.Holder(); | 80 v8::Local<v8::Object> wrapper = info.Holder(); |
| 82 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor2::wrapperTypeInfo, wrapper); | 81 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor2::wrapperTypeInfo, wrapper); |
| 83 v8SetReturnValue(info, wrapper); | 82 v8SetReturnValue(info, wrapper); |
| 84 } | 83 } |
| 85 | 84 |
| 86 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) | 85 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 87 { | 86 { |
| 88 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); | 87 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); |
| 89 Vector<Vector<String>> stringSequenceSequenceArg; | 88 Vector<Vector<String>> stringSequenceSequenceArg; |
| 90 { | 89 { |
| 91 stringSequenceSequenceArg = toImplArray<Vector<Vector<String>>>(info[0],
1, info.GetIsolate(), exceptionState); | 90 stringSequenceSequenceArg = toImplArray<Vector<Vector<String>>>(info[0],
1, info.GetIsolate(), exceptionState); |
| 92 if (exceptionState.throwIfNeeded()) | 91 if (exceptionState.hadException()) |
| 93 return; | 92 return; |
| 94 } | 93 } |
| 95 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringSe
quenceSequenceArg); | 94 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(stringSe
quenceSequenceArg); |
| 96 v8::Local<v8::Object> wrapper = info.Holder(); | 95 v8::Local<v8::Object> wrapper = info.Holder(); |
| 97 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor2::wrapperTypeInfo, wrapper); | 96 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor2::wrapperTypeInfo, wrapper); |
| 98 v8SetReturnValue(info, wrapper); | 97 v8SetReturnValue(info, wrapper); |
| 99 } | 98 } |
| 100 | 99 |
| 101 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) | 100 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 102 { | 101 { |
| 103 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); | 102 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor2", info.Holder(), info.GetIsolate()); |
| 104 TestInterfaceEmpty* testInterfaceEmptyArg; | 103 TestInterfaceEmpty* testInterfaceEmptyArg; |
| 105 int longArg; | 104 int longArg; |
| 106 V8StringResource<> defaultUndefinedOptionalStringArg; | 105 V8StringResource<> defaultUndefinedOptionalStringArg; |
| 107 V8StringResource<> defaultNullStringOptionalStringArg; | 106 V8StringResource<> defaultNullStringOptionalStringArg; |
| 108 Dictionary defaultUndefinedOptionalDictionaryArg; | 107 Dictionary defaultUndefinedOptionalDictionaryArg; |
| 109 V8StringResource<> optionalStringArg; | 108 V8StringResource<> optionalStringArg; |
| 110 { | 109 { |
| 111 int numArgsPassed = info.Length(); | 110 int numArgsPassed = info.Length(); |
| 112 while (numArgsPassed > 0) { | 111 while (numArgsPassed > 0) { |
| 113 if (!info[numArgsPassed - 1]->IsUndefined()) | 112 if (!info[numArgsPassed - 1]->IsUndefined()) |
| 114 break; | 113 break; |
| 115 --numArgsPassed; | 114 --numArgsPassed; |
| 116 } | 115 } |
| 117 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[0]); | 116 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[0]); |
| 118 if (!testInterfaceEmptyArg) { | 117 if (!testInterfaceEmptyArg) { |
| 119 exceptionState.throwTypeError("parameter 1 is not of type 'TestInter
faceEmpty'."); | 118 exceptionState.throwTypeError("parameter 1 is not of type 'TestInter
faceEmpty'."); |
| 120 exceptionState.throwIfNeeded(); | |
| 121 return; | 119 return; |
| 122 } | 120 } |
| 123 longArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptio
nState); | 121 longArg = toInt32(info.GetIsolate(), info[1], NormalConversion, exceptio
nState); |
| 124 if (exceptionState.throwIfNeeded()) | 122 if (exceptionState.hadException()) |
| 125 return; | 123 return; |
| 126 defaultUndefinedOptionalStringArg = info[2]; | 124 defaultUndefinedOptionalStringArg = info[2]; |
| 127 if (!defaultUndefinedOptionalStringArg.prepare()) | 125 if (!defaultUndefinedOptionalStringArg.prepare()) |
| 128 return; | 126 return; |
| 129 if (!info[3]->IsUndefined()) { | 127 if (!info[3]->IsUndefined()) { |
| 130 defaultNullStringOptionalStringArg = info[3]; | 128 defaultNullStringOptionalStringArg = info[3]; |
| 131 if (!defaultNullStringOptionalStringArg.prepare()) | 129 if (!defaultNullStringOptionalStringArg.prepare()) |
| 132 return; | 130 return; |
| 133 } else { | 131 } else { |
| 134 defaultNullStringOptionalStringArg = nullptr; | 132 defaultNullStringOptionalStringArg = nullptr; |
| 135 } | 133 } |
| 136 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) { | 134 if (!isUndefinedOrNull(info[4]) && !info[4]->IsObject()) { |
| 137 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona
lDictionaryArg') is not an object."); | 135 exceptionState.throwTypeError("parameter 5 ('defaultUndefinedOptiona
lDictionaryArg') is not an object."); |
| 138 exceptionState.throwIfNeeded(); | |
| 139 return; | 136 return; |
| 140 } | 137 } |
| 141 defaultUndefinedOptionalDictionaryArg = Dictionary(info[4], info.GetIsol
ate(), exceptionState); | 138 defaultUndefinedOptionalDictionaryArg = Dictionary(info[4], info.GetIsol
ate(), exceptionState); |
| 142 if (exceptionState.throwIfNeeded()) | 139 if (exceptionState.hadException()) |
| 143 return; | 140 return; |
| 144 if (UNLIKELY(numArgsPassed <= 5)) { | 141 if (UNLIKELY(numArgsPassed <= 5)) { |
| 145 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(
testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullSt
ringOptionalStringArg, defaultUndefinedOptionalDictionaryArg); | 142 TestInterfaceConstructor2* impl = TestInterfaceConstructor2::create(
testInterfaceEmptyArg, longArg, defaultUndefinedOptionalStringArg, defaultNullSt
ringOptionalStringArg, defaultUndefinedOptionalDictionaryArg); |
| 146 v8::Local<v8::Object> wrapper = info.Holder(); | 143 v8::Local<v8::Object> wrapper = info.Holder(); |
| 147 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructor2::wrapperTypeInfo, wrapper); | 144 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructor2::wrapperTypeInfo, wrapper); |
| 148 v8SetReturnValue(info, wrapper); | 145 v8SetReturnValue(info, wrapper); |
| 149 return; | 146 return; |
| 150 } | 147 } |
| 151 optionalStringArg = info[5]; | 148 optionalStringArg = info[5]; |
| 152 if (!optionalStringArg.prepare()) | 149 if (!optionalStringArg.prepare()) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } | 198 } |
| 202 break; | 199 break; |
| 203 case 6: | 200 case 6: |
| 204 if (true) { | 201 if (true) { |
| 205 TestInterfaceConstructor2V8Internal::constructor4(info); | 202 TestInterfaceConstructor2V8Internal::constructor4(info); |
| 206 return; | 203 return; |
| 207 } | 204 } |
| 208 break; | 205 break; |
| 209 default: | 206 default: |
| 210 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 207 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 211 exceptionState.throwIfNeeded(); | |
| 212 return; | 208 return; |
| 213 } | 209 } |
| 214 exceptionState.throwTypeError("No matching constructor signature."); | 210 exceptionState.throwTypeError("No matching constructor signature."); |
| 215 exceptionState.throwIfNeeded(); | |
| 216 } | 211 } |
| 217 | 212 |
| 218 } // namespace TestInterfaceConstructor2V8Internal | 213 } // namespace TestInterfaceConstructor2V8Internal |
| 219 | 214 |
| 220 void V8TestInterfaceConstructor2::constructorCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 215 void V8TestInterfaceConstructor2::constructorCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 221 { | 216 { |
| 222 if (!info.IsConstructCall()) { | 217 if (!info.IsConstructCall()) { |
| 223 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceConstructor2")); | 218 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceConstructor2")); |
| 224 return; | 219 return; |
| 225 } | 220 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 { | 256 { |
| 262 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 257 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 263 } | 258 } |
| 264 | 259 |
| 265 TestInterfaceConstructor2* V8TestInterfaceConstructor2::toImplWithTypeCheck(v8::
Isolate* isolate, v8::Local<v8::Value> value) | 260 TestInterfaceConstructor2* V8TestInterfaceConstructor2::toImplWithTypeCheck(v8::
Isolate* isolate, v8::Local<v8::Value> value) |
| 266 { | 261 { |
| 267 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 262 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 268 } | 263 } |
| 269 | 264 |
| 270 } // namespace blink | 265 } // namespace blink |
| OLD | NEW |