| 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 "V8TestInterfaceConstructor.h" | 7 #include "V8TestInterfaceConstructor.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 std::is_same<decltype(&TestInterfaceConstructor::hasPendingActivity), | 48 std::is_same<decltype(&TestInterfaceConstructor::hasPendingActivity), |
| 49 decltype(&ScriptWrappable::hasPendingActivity)>::value, | 49 decltype(&ScriptWrappable::hasPendingActivity)>::value, |
| 50 "TestInterfaceConstructor is overriding hasPendingActivity(), but is not spe
cifying " | 50 "TestInterfaceConstructor is overriding hasPendingActivity(), but is not spe
cifying " |
| 51 "[ActiveScriptWrappable] extended attribute in the IDL file. " | 51 "[ActiveScriptWrappable] extended attribute in the IDL file. " |
| 52 "Be consistent."); | 52 "Be consistent."); |
| 53 | 53 |
| 54 namespace TestInterfaceConstructorV8Internal { | 54 namespace TestInterfaceConstructorV8Internal { |
| 55 | 55 |
| 56 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) | 56 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 57 { | 57 { |
| 58 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 58 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor"); |
| 59 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 59 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 60 |
| 60 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 61 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 61 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 62 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
| 62 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, exceptionState); | 63 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, exceptionState); |
| 63 if (exceptionState.hadException()) { | 64 if (exceptionState.hadException()) { |
| 64 return; | 65 return; |
| 65 } | 66 } |
| 66 v8::Local<v8::Object> wrapper = info.Holder(); | 67 v8::Local<v8::Object> wrapper = info.Holder(); |
| 67 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 68 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
| 68 v8SetReturnValue(info, wrapper); | 69 v8SetReturnValue(info, wrapper); |
| 69 } | 70 } |
| 70 | 71 |
| 71 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) | 72 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 72 { | 73 { |
| 73 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 74 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor"); |
| 75 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 76 |
| 74 double doubleArg; | 77 double doubleArg; |
| 75 V8StringResource<> stringArg; | 78 V8StringResource<> stringArg; |
| 76 TestInterfaceEmpty* testInterfaceEmptyArg; | 79 TestInterfaceEmpty* testInterfaceEmptyArg; |
| 77 Dictionary dictionaryArg; | 80 Dictionary dictionaryArg; |
| 78 Vector<String> sequenceStringArg; | 81 Vector<String> sequenceStringArg; |
| 79 Vector<Dictionary> sequenceDictionaryArg; | 82 Vector<Dictionary> sequenceDictionaryArg; |
| 80 HeapVector<LongOrTestDictionary> sequenceLongOrTestDictionaryArg; | 83 HeapVector<LongOrTestDictionary> sequenceLongOrTestDictionaryArg; |
| 81 Dictionary optionalDictionaryArg; | 84 Dictionary optionalDictionaryArg; |
| 82 TestInterfaceEmpty* optionalTestInterfaceEmptyArg; | 85 TestInterfaceEmpty* optionalTestInterfaceEmptyArg; |
| 83 { | 86 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); |
| 84 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionStat
e); | 87 if (exceptionState.hadException()) |
| 85 if (exceptionState.hadException()) | 88 return; |
| 86 return; | 89 |
| 87 stringArg = info[1]; | 90 stringArg = info[1]; |
| 88 if (!stringArg.prepare()) | 91 if (!stringArg.prepare()) |
| 89 return; | 92 return; |
| 90 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G
etIsolate(), info[2]); | 93 |
| 91 if (!testInterfaceEmptyArg) { | 94 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIs
olate(), info[2]); |
| 92 exceptionState.throwTypeError("parameter 3 is not of type 'TestInter
faceEmpty'."); | 95 if (!testInterfaceEmptyArg) { |
| 93 return; | 96 exceptionState.throwTypeError("parameter 3 is not of type 'TestInterface
Empty'."); |
| 94 } | 97 |
| 95 if (!isUndefinedOrNull(info[3]) && !info[3]->IsObject()) { | 98 return; |
| 96 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not
an object."); | |
| 97 return; | |
| 98 } | |
| 99 dictionaryArg = Dictionary(info[3], info.GetIsolate(), exceptionState); | |
| 100 if (exceptionState.hadException()) | |
| 101 return; | |
| 102 sequenceStringArg = toImplArray<Vector<String>>(info[4], 5, info.GetIsol
ate(), exceptionState); | |
| 103 if (exceptionState.hadException()) | |
| 104 return; | |
| 105 sequenceDictionaryArg = toImplArray<Vector<Dictionary>>(info[5], 6, info
.GetIsolate(), exceptionState); | |
| 106 if (exceptionState.hadException()) | |
| 107 return; | |
| 108 sequenceLongOrTestDictionaryArg = toImplArray<HeapVector<LongOrTestDicti
onary>>(info[6], 7, info.GetIsolate(), exceptionState); | |
| 109 if (exceptionState.hadException()) | |
| 110 return; | |
| 111 if (!isUndefinedOrNull(info[7]) && !info[7]->IsObject()) { | |
| 112 exceptionState.throwTypeError("parameter 8 ('optionalDictionaryArg')
is not an object."); | |
| 113 return; | |
| 114 } | |
| 115 optionalDictionaryArg = Dictionary(info[7], info.GetIsolate(), exception
State); | |
| 116 if (exceptionState.hadException()) | |
| 117 return; | |
| 118 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeChec
k(info.GetIsolate(), info[8]); | |
| 119 if (!optionalTestInterfaceEmptyArg) { | |
| 120 exceptionState.throwTypeError("parameter 9 is not of type 'TestInter
faceEmpty'."); | |
| 121 return; | |
| 122 } | |
| 123 } | 99 } |
| 124 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 100 |
| 101 if (!isUndefinedOrNull(info[3]) && !info[3]->IsObject()) { |
| 102 exceptionState.throwTypeError("parameter 4 ('dictionaryArg') is not an o
bject."); |
| 103 |
| 104 return; |
| 105 } |
| 106 dictionaryArg = Dictionary(info[3], info.GetIsolate(), exceptionState); |
| 107 if (exceptionState.hadException()) |
| 108 return; |
| 109 |
| 110 sequenceStringArg = toImplArray<Vector<String>>(info[4], 5, info.GetIsolate(
), exceptionState); |
| 111 if (exceptionState.hadException()) |
| 112 return; |
| 113 |
| 114 sequenceDictionaryArg = toImplArray<Vector<Dictionary>>(info[5], 6, info.Get
Isolate(), exceptionState); |
| 115 if (exceptionState.hadException()) |
| 116 return; |
| 117 |
| 118 sequenceLongOrTestDictionaryArg = toImplArray<HeapVector<LongOrTestDictionar
y>>(info[6], 7, info.GetIsolate(), exceptionState); |
| 119 if (exceptionState.hadException()) |
| 120 return; |
| 121 |
| 122 if (!isUndefinedOrNull(info[7]) && !info[7]->IsObject()) { |
| 123 exceptionState.throwTypeError("parameter 8 ('optionalDictionaryArg') is
not an object."); |
| 124 |
| 125 return; |
| 126 } |
| 127 optionalDictionaryArg = Dictionary(info[7], info.GetIsolate(), exceptionStat
e); |
| 128 if (exceptionState.hadException()) |
| 129 return; |
| 130 |
| 131 optionalTestInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(in
fo.GetIsolate(), info[8]); |
| 132 if (!optionalTestInterfaceEmptyArg) { |
| 133 exceptionState.throwTypeError("parameter 9 is not of type 'TestInterface
Empty'."); |
| 134 |
| 135 return; |
| 136 } |
| 137 |
| 125 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 138 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 126 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 139 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
| 127 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dict
ionaryArg, sequenceStringArg, sequenceDictionaryArg, sequenceLongOrTestDictionar
yArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionState); | 140 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dict
ionaryArg, sequenceStringArg, sequenceDictionaryArg, sequenceLongOrTestDictionar
yArg, optionalDictionaryArg, optionalTestInterfaceEmptyArg, exceptionState); |
| 128 if (exceptionState.hadException()) { | 141 if (exceptionState.hadException()) { |
| 129 return; | 142 return; |
| 130 } | 143 } |
| 131 v8::Local<v8::Object> wrapper = info.Holder(); | 144 v8::Local<v8::Object> wrapper = info.Holder(); |
| 132 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 145 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
| 133 v8SetReturnValue(info, wrapper); | 146 v8SetReturnValue(info, wrapper); |
| 134 } | 147 } |
| 135 | 148 |
| 136 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) | 149 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 137 { | 150 { |
| 138 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 151 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor"); |
| 152 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 153 |
| 139 V8StringResource<> arg; | 154 V8StringResource<> arg; |
| 140 V8StringResource<> optArg; | 155 V8StringResource<> optArg; |
| 141 { | 156 int numArgsPassed = info.Length(); |
| 142 int numArgsPassed = info.Length(); | 157 while (numArgsPassed > 0) { |
| 143 while (numArgsPassed > 0) { | 158 if (!info[numArgsPassed - 1]->IsUndefined()) |
| 144 if (!info[numArgsPassed - 1]->IsUndefined()) | 159 break; |
| 145 break; | 160 --numArgsPassed; |
| 146 --numArgsPassed; | 161 } |
| 147 } | 162 arg = info[0]; |
| 148 arg = info[0]; | 163 if (!arg.prepare()) |
| 149 if (!arg.prepare()) | 164 return; |
| 150 return; | 165 |
| 151 if (UNLIKELY(numArgsPassed <= 1)) { | 166 if (UNLIKELY(numArgsPassed <= 1)) { |
| 152 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 167 ExecutionContext* executionContext = currentExecutionContext(info.GetIso
late()); |
| 153 ExecutionContext* executionContext = currentExecutionContext(info.Ge
tIsolate()); | 168 Document& document = *toDocument(currentExecutionContext(info.GetIsolate
())); |
| 154 Document& document = *toDocument(currentExecutionContext(info.GetIso
late())); | 169 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(script
State, executionContext, document, arg, exceptionState); |
| 155 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(sc
riptState, executionContext, document, arg, exceptionState); | 170 if (exceptionState.hadException()) { |
| 156 if (exceptionState.hadException()) { | |
| 157 return; | |
| 158 } | |
| 159 v8::Local<v8::Object> wrapper = info.Holder(); | |
| 160 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructor::wrapperTypeInfo, wrapper); | |
| 161 v8SetReturnValue(info, wrapper); | |
| 162 return; | 171 return; |
| 163 } | 172 } |
| 164 optArg = info[1]; | 173 v8::Local<v8::Object> wrapper = info.Holder(); |
| 165 if (!optArg.prepare()) | 174 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface
Constructor::wrapperTypeInfo, wrapper); |
| 166 return; | 175 v8SetReturnValue(info, wrapper); |
| 176 return; |
| 167 } | 177 } |
| 168 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 178 optArg = info[1]; |
| 179 if (!optArg.prepare()) |
| 180 return; |
| 181 |
| 169 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 182 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 170 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 183 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
| 171 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, optArg, exceptionState); | 184 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, optArg, exceptionState); |
| 172 if (exceptionState.hadException()) { | 185 if (exceptionState.hadException()) { |
| 173 return; | 186 return; |
| 174 } | 187 } |
| 175 v8::Local<v8::Object> wrapper = info.Holder(); | 188 v8::Local<v8::Object> wrapper = info.Holder(); |
| 176 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 189 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
| 177 v8SetReturnValue(info, wrapper); | 190 v8SetReturnValue(info, wrapper); |
| 178 } | 191 } |
| 179 | 192 |
| 180 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) | 193 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 181 { | 194 { |
| 182 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 195 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor"); |
| 196 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 197 |
| 183 V8StringResource<> arg; | 198 V8StringResource<> arg; |
| 184 V8StringResource<> arg2; | 199 V8StringResource<> arg2; |
| 185 V8StringResource<> arg3; | 200 V8StringResource<> arg3; |
| 186 { | 201 arg = info[0]; |
| 187 arg = info[0]; | 202 if (!arg.prepare()) |
| 188 if (!arg.prepare()) | 203 return; |
| 189 return; | 204 |
| 190 arg2 = info[1]; | 205 arg2 = info[1]; |
| 191 if (!arg2.prepare()) | 206 if (!arg2.prepare()) |
| 192 return; | 207 return; |
| 193 arg3 = info[2]; | 208 |
| 194 if (!arg3.prepare()) | 209 arg3 = info[2]; |
| 195 return; | 210 if (!arg3.prepare()) |
| 196 } | 211 return; |
| 197 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 212 |
| 198 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 213 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 199 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 214 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
| 200 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, arg2, arg3, exceptionState); | 215 TestInterfaceConstructor* impl = TestInterfaceConstructor::create(scriptStat
e, executionContext, document, arg, arg2, arg3, exceptionState); |
| 201 if (exceptionState.hadException()) { | 216 if (exceptionState.hadException()) { |
| 202 return; | 217 return; |
| 203 } | 218 } |
| 204 v8::Local<v8::Object> wrapper = info.Holder(); | 219 v8::Local<v8::Object> wrapper = info.Holder(); |
| 205 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); | 220 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor::wrapperTypeInfo, wrapper); |
| 206 v8SetReturnValue(info, wrapper); | 221 v8SetReturnValue(info, wrapper); |
| 207 } | 222 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 { | 295 { |
| 281 if (!info.IsConstructCall()) { | 296 if (!info.IsConstructCall()) { |
| 282 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("Audio")); | 297 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("Audio")); |
| 283 return; | 298 return; |
| 284 } | 299 } |
| 285 | 300 |
| 286 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { | 301 if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExis
tingObject) { |
| 287 v8SetReturnValue(info, info.Holder()); | 302 v8SetReturnValue(info, info.Holder()); |
| 288 return; | 303 return; |
| 289 } | 304 } |
| 290 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor", info.Holder(), info.GetIsolate()); | 305 |
| 306 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::Constructio
nContext, "TestInterfaceConstructor"); |
| 307 ScriptState* scriptState = ScriptState::forReceiverObject(info); |
| 308 |
| 291 if (UNLIKELY(info.Length() < 1)) { | 309 if (UNLIKELY(info.Length() < 1)) { |
| 292 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 310 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 293 return; | 311 return; |
| 294 } | 312 } |
| 313 |
| 295 V8StringResource<> arg; | 314 V8StringResource<> arg; |
| 296 V8StringResource<> optArg; | 315 V8StringResource<> optArg; |
| 297 { | 316 int numArgsPassed = info.Length(); |
| 298 int numArgsPassed = info.Length(); | 317 while (numArgsPassed > 0) { |
| 299 while (numArgsPassed > 0) { | 318 if (!info[numArgsPassed - 1]->IsUndefined()) |
| 300 if (!info[numArgsPassed - 1]->IsUndefined()) | 319 break; |
| 301 break; | 320 --numArgsPassed; |
| 302 --numArgsPassed; | 321 } |
| 303 } | 322 arg = info[0]; |
| 304 arg = info[0]; | 323 if (!arg.prepare()) |
| 305 if (!arg.prepare()) | 324 return; |
| 306 return; | 325 |
| 307 if (UNLIKELY(numArgsPassed <= 1)) { | 326 if (UNLIKELY(numArgsPassed <= 1)) { |
| 308 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 327 ExecutionContext* executionContext = currentExecutionContext(info.GetIso
late()); |
| 309 ExecutionContext* executionContext = currentExecutionContext(info.Ge
tIsolate()); | 328 Document& document = *toDocument(currentExecutionContext(info.GetIsolate
())); |
| 310 Document& document = *toDocument(currentExecutionContext(info.GetIso
late())); | 329 TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSCo
nstructor(scriptState, executionContext, document, arg, exceptionState); |
| 311 TestInterfaceConstructor* impl = TestInterfaceConstructor::createFor
JSConstructor(scriptState, executionContext, document, arg, exceptionState); | 330 if (exceptionState.hadException()) { |
| 312 if (exceptionState.hadException()) { | |
| 313 return; | |
| 314 } | |
| 315 v8::Local<v8::Object> wrapper = info.Holder(); | |
| 316 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInter
faceConstructorConstructor::wrapperTypeInfo, wrapper); | |
| 317 v8SetReturnValue(info, wrapper); | |
| 318 return; | 331 return; |
| 319 } | 332 } |
| 320 optArg = info[1]; | 333 v8::Local<v8::Object> wrapper = info.Holder(); |
| 321 if (!optArg.prepare()) | 334 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterface
ConstructorConstructor::wrapperTypeInfo, wrapper); |
| 322 return; | 335 v8SetReturnValue(info, wrapper); |
| 336 return; |
| 323 } | 337 } |
| 324 ScriptState* scriptState = ScriptState::forReceiverObject(info); | 338 optArg = info[1]; |
| 339 if (!optArg.prepare()) |
| 340 return; |
| 341 |
| 325 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 342 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 326 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; | 343 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()))
; |
| 327 TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstr
uctor(scriptState, executionContext, document, arg, optArg, exceptionState); | 344 TestInterfaceConstructor* impl = TestInterfaceConstructor::createForJSConstr
uctor(scriptState, executionContext, document, arg, optArg, exceptionState); |
| 328 if (exceptionState.hadException()) { | 345 if (exceptionState.hadException()) { |
| 329 return; | 346 return; |
| 330 } | 347 } |
| 331 v8::Local<v8::Object> wrapper = info.Holder(); | 348 v8::Local<v8::Object> wrapper = info.Holder(); |
| 332 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructorConstructor::wrapperTypeInfo, wrapper); | 349 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructorConstructor::wrapperTypeInfo, wrapper); |
| 333 v8SetReturnValue(info, wrapper); | 350 v8SetReturnValue(info, wrapper); |
| 334 } | 351 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 { | 412 { |
| 396 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 413 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 397 } | 414 } |
| 398 | 415 |
| 399 TestInterfaceConstructor* V8TestInterfaceConstructor::toImplWithTypeCheck(v8::Is
olate* isolate, v8::Local<v8::Value> value) | 416 TestInterfaceConstructor* V8TestInterfaceConstructor::toImplWithTypeCheck(v8::Is
olate* isolate, v8::Local<v8::Value> value) |
| 400 { | 417 { |
| 401 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 418 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 402 } | 419 } |
| 403 | 420 |
| 404 } // namespace blink | 421 } // namespace blink |
| OLD | NEW |