| 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 "V8TestInterfaceNamedConstructor.h" | 7 #include "V8TestInterfaceNamedConstructor.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/GeneratedCodeHelper.h" | 10 #include "bindings/core/v8/GeneratedCodeHelper.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 { | 78 { |
| 79 if (!info.IsConstructCall()) { | 79 if (!info.IsConstructCall()) { |
| 80 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("Audio")); | 80 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("Audio")); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { | 84 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { |
| 85 v8SetReturnValue(info, info.Holder()); | 85 v8SetReturnValue(info, info.Holder()); |
| 86 return; | 86 return; |
| 87 } | 87 } |
| 88 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceNamedConstructor", info.Holder(), info.GetIsolate()); | 88 |
| 89 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceNamedConstructor"); |
| 90 |
| 89 if (UNLIKELY(info.Length() < 1)) { | 91 if (UNLIKELY(info.Length() < 1)) { |
| 90 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 92 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 91 return; | 93 return; |
| 92 } | 94 } |
| 95 |
| 93 V8StringResource<> stringArg; | 96 V8StringResource<> stringArg; |
| 94 bool defaultUndefinedOptionalBooleanArg; | 97 bool defaultUndefinedOptionalBooleanArg; |
| 95 int defaultUndefinedOptionalLongArg; | 98 int defaultUndefinedOptionalLongArg; |
| 96 V8StringResource<> defaultUndefinedOptionalStringArg; | 99 V8StringResource<> defaultUndefinedOptionalStringArg; |
| 97 V8StringResource<> defaultNullStringOptionalstringArg; | 100 V8StringResource<> defaultNullStringOptionalstringArg; |
| 98 V8StringResource<> optionalStringArg; | 101 V8StringResource<> optionalStringArg; |
| 99 { | 102 int numArgsPassed = info.Length(); |
| 100 int numArgsPassed = info.Length(); | 103 while (numArgsPassed > 0) { |
| 101 while (numArgsPassed > 0) { | 104 if (!info[numArgsPassed - 1]->IsUndefined()) |
| 102 if (!info[numArgsPassed - 1]->IsUndefined()) | 105 break; |
| 103 break; | 106 --numArgsPassed; |
| 104 --numArgsPassed; | 107 } |
| 105 } | 108 stringArg = info[0]; |
| 106 stringArg = info[0]; | 109 if (!stringArg.prepare()) |
| 107 if (!stringArg.prepare()) | 110 return; |
| 111 |
| 112 defaultUndefinedOptionalBooleanArg = toBoolean(info.GetIsolate(), info[1], e
xceptionState); |
| 113 if (exceptionState.hadException()) |
| 114 return; |
| 115 |
| 116 defaultUndefinedOptionalLongArg = toInt32(info.GetIsolate(), info[2], Normal
Conversion, exceptionState); |
| 117 if (exceptionState.hadException()) |
| 118 return; |
| 119 |
| 120 defaultUndefinedOptionalStringArg = info[3]; |
| 121 if (!defaultUndefinedOptionalStringArg.prepare()) |
| 122 return; |
| 123 |
| 124 if (!info[4]->IsUndefined()) { |
| 125 defaultNullStringOptionalstringArg = info[4]; |
| 126 if (!defaultNullStringOptionalstringArg.prepare()) |
| 108 return; | 127 return; |
| 109 defaultUndefinedOptionalBooleanArg = toBoolean(info.GetIsolate(), info[1
], exceptionState); | 128 } else { |
| 110 if (exceptionState.hadException()) | 129 defaultNullStringOptionalstringArg = nullptr; |
| 111 return; | 130 } |
| 112 defaultUndefinedOptionalLongArg = toInt32(info.GetIsolate(), info[2], No
rmalConversion, exceptionState); | 131 if (UNLIKELY(numArgsPassed <= 5)) { |
| 113 if (exceptionState.hadException()) | 132 Document& document = *toDocument(currentExecutionContext(info.GetIsolate
())); |
| 114 return; | 133 TestInterfaceNamedConstructor* impl = TestInterfaceNamedConstructor::cre
ateForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, def
aultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStri
ngOptionalstringArg, exceptionState); |
| 115 defaultUndefinedOptionalStringArg = info[3]; | 134 if (exceptionState.hadException()) { |
| 116 if (!defaultUndefinedOptionalStringArg.prepare()) | |
| 117 return; | |
| 118 if (!info[4]->IsUndefined()) { | |
| 119 defaultNullStringOptionalstringArg = info[4]; | |
| 120 if (!defaultNullStringOptionalstringArg.prepare()) | |
| 121 return; | |
| 122 } else { | |
| 123 defaultNullStringOptionalstringArg = nullptr; | |
| 124 } | |
| 125 if (UNLIKELY(numArgsPassed <= 5)) { | |
| 126 Document& document = *toDocument(currentExecutionContext(info.GetIso
late())); | |
| 127 TestInterfaceNamedConstructor* impl = TestInterfaceNamedConstructor:
:createForJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg,
defaultUndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNull
StringOptionalstringArg, exceptionState); | |
| 128 if (exceptionState.hadException()) { | |
| 129 return; | |
| 130 } | |
| 131 v8::Local<v8::Object> wrapper = info.Holder(); | |
| 132 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceNamedConstructorConstructor::wrapperTypeInfo, wrapper); | |
| 133 v8SetReturnValue(info, wrapper); | |
| 134 return; | 135 return; |
| 135 } | 136 } |
| 136 optionalStringArg = info[5]; | 137 v8::Local<v8::Object> wrapper = info.Holder(); |
| 137 if (!optionalStringArg.prepare()) | 138 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface
NamedConstructorConstructor::wrapperTypeInfo, wrapper); |
| 138 return; | 139 v8SetReturnValue(info, wrapper); |
| 140 return; |
| 139 } | 141 } |
| 142 optionalStringArg = info[5]; |
| 143 if (!optionalStringArg.prepare()) |
| 144 return; |
| 145 |
| 140 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 146 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
| 141 TestInterfaceNamedConstructor* impl = TestInterfaceNamedConstructor::createF
orJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, default
UndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOp
tionalstringArg, optionalStringArg, exceptionState); | 147 TestInterfaceNamedConstructor* impl = TestInterfaceNamedConstructor::createF
orJSConstructor(document, stringArg, defaultUndefinedOptionalBooleanArg, default
UndefinedOptionalLongArg, defaultUndefinedOptionalStringArg, defaultNullStringOp
tionalstringArg, optionalStringArg, exceptionState); |
| 142 if (exceptionState.hadException()) { | 148 if (exceptionState.hadException()) { |
| 143 return; | 149 return; |
| 144 } | 150 } |
| 145 v8::Local<v8::Object> wrapper = info.Holder(); | 151 v8::Local<v8::Object> wrapper = info.Holder(); |
| 146 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceName
dConstructorConstructor::wrapperTypeInfo, wrapper); | 152 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceName
dConstructorConstructor::wrapperTypeInfo, wrapper); |
| 147 v8SetReturnValue(info, wrapper); | 153 v8SetReturnValue(info, wrapper); |
| 148 } | 154 } |
| 149 | 155 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 { | 198 { |
| 193 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 199 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 194 } | 200 } |
| 195 | 201 |
| 196 TestInterfaceNamedConstructor* V8TestInterfaceNamedConstructor::toImplWithTypeCh
eck(v8::Isolate* isolate, v8::Local<v8::Value> value) | 202 TestInterfaceNamedConstructor* V8TestInterfaceNamedConstructor::toImplWithTypeCh
eck(v8::Isolate* isolate, v8::Local<v8::Value> value) |
| 197 { | 203 { |
| 198 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 204 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 199 } | 205 } |
| 200 | 206 |
| 201 } // namespace blink | 207 } // namespace blink |
| OLD | NEW |