| 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 "V8TestInterfaceConstructor4.h" | 7 #include "V8TestInterfaceConstructor4.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/V8DOMConfiguration.h" | 10 #include "bindings/core/v8/V8DOMConfiguration.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); | 63 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); |
| 64 v8SetReturnValue(info, wrapper); | 64 v8SetReturnValue(info, wrapper); |
| 65 } | 65 } |
| 66 | 66 |
| 67 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) | 67 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 68 { | 68 { |
| 69 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor4", info.Holder(), info.GetIsolate()); | 69 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor4", info.Holder(), info.GetIsolate()); |
| 70 V8StringResource<> usvStringArg; | 70 V8StringResource<> usvStringArg; |
| 71 { | 71 { |
| 72 usvStringArg = toUSVString(info.GetIsolate(), info[0], exceptionState); | 72 usvStringArg = toUSVString(info.GetIsolate(), info[0], exceptionState); |
| 73 if (exceptionState.throwIfNeeded()) | 73 if (exceptionState.hadException()) |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(usvStrin
gArg); | 76 TestInterfaceConstructor4* impl = TestInterfaceConstructor4::create(usvStrin
gArg); |
| 77 v8::Local<v8::Object> wrapper = info.Holder(); | 77 v8::Local<v8::Object> wrapper = info.Holder(); |
| 78 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); | 78 wrapper = impl->associateWithWrapper(info.GetIsolate(), &V8TestInterfaceCons
tructor4::wrapperTypeInfo, wrapper); |
| 79 v8SetReturnValue(info, wrapper); | 79 v8SetReturnValue(info, wrapper); |
| 80 } | 80 } |
| 81 | 81 |
| 82 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 82 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 83 { | 83 { |
| 84 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor4", info.Holder(), info.GetIsolate()); | 84 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rfaceConstructor4", info.Holder(), info.GetIsolate()); |
| 85 switch (std::min(1, info.Length())) { | 85 switch (std::min(1, info.Length())) { |
| 86 case 1: | 86 case 1: |
| 87 if (V8TestInterfaceConstructor4::hasInstance(info[0], info.GetIsolate())
) { | 87 if (V8TestInterfaceConstructor4::hasInstance(info[0], info.GetIsolate())
) { |
| 88 TestInterfaceConstructor4V8Internal::constructor1(info); | 88 TestInterfaceConstructor4V8Internal::constructor1(info); |
| 89 return; | 89 return; |
| 90 } | 90 } |
| 91 if (true) { | 91 if (true) { |
| 92 TestInterfaceConstructor4V8Internal::constructor2(info); | 92 TestInterfaceConstructor4V8Internal::constructor2(info); |
| 93 return; | 93 return; |
| 94 } | 94 } |
| 95 break; | 95 break; |
| 96 default: | 96 default: |
| 97 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 97 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 98 exceptionState.throwIfNeeded(); | |
| 99 return; | 98 return; |
| 100 } | 99 } |
| 101 exceptionState.throwTypeError("No matching constructor signature."); | 100 exceptionState.throwTypeError("No matching constructor signature."); |
| 102 exceptionState.throwIfNeeded(); | |
| 103 } | 101 } |
| 104 | 102 |
| 105 } // namespace TestInterfaceConstructor4V8Internal | 103 } // namespace TestInterfaceConstructor4V8Internal |
| 106 | 104 |
| 107 void V8TestInterfaceConstructor4::constructorCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 105 void V8TestInterfaceConstructor4::constructorCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
| 108 { | 106 { |
| 109 if (!info.IsConstructCall()) { | 107 if (!info.IsConstructCall()) { |
| 110 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceConstructor4")); | 108 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c
onstructorNotCallableAsFunction("TestInterfaceConstructor4")); |
| 111 return; | 109 return; |
| 112 } | 110 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 { | 146 { |
| 149 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 147 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
| 150 } | 148 } |
| 151 | 149 |
| 152 TestInterfaceConstructor4* V8TestInterfaceConstructor4::toImplWithTypeCheck(v8::
Isolate* isolate, v8::Local<v8::Value> value) | 150 TestInterfaceConstructor4* V8TestInterfaceConstructor4::toImplWithTypeCheck(v8::
Isolate* isolate, v8::Local<v8::Value> value) |
| 153 { | 151 { |
| 154 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; | 152 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(valu
e)) : nullptr; |
| 155 } | 153 } |
| 156 | 154 |
| 157 } // namespace blink | 155 } // namespace blink |
| OLD | NEW |