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

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

Issue 284163002: Better arity checks for overloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return properly Created 6 years, 7 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 | Annotate | Revision Log
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 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 } 801 }
802 802
803 static void TestInterfaceImplementationReplaceableAttributeSetterCallback(v8::Lo cal<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackIn fo<void>& info) 803 static void TestInterfaceImplementationReplaceableAttributeSetterCallback(v8::Lo cal<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackIn fo<void>& info)
804 { 804 {
805 TestInterfaceImplementationV8Internal::TestInterfaceImplementationReplaceabl eAttributeSetter(name, v8Value, info); 805 TestInterfaceImplementationV8Internal::TestInterfaceImplementationReplaceabl eAttributeSetter(name, v8Value, info);
806 } 806 }
807 807
808 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) 808 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info)
809 { 809 {
810 if (UNLIKELY(info.Length() < 1)) { 810 if (UNLIKELY(info.Length() < 1)) {
811 throwArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", "TestInt erface", 1, info.Length(), info.GetIsolate()); 811 throwMinimumArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", " TestInterface", 1, info.Length(), info.GetIsolate());
812 return; 812 return;
813 } 813 }
814 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 814 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
815 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.Ge tIsolate())) { 815 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.Ge tIsolate())) {
816 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfa ceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'." ), info.GetIsolate()); 816 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfa ceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'." ), info.GetIsolate());
817 return; 817 return;
818 } 818 }
819 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); 819 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
820 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 820 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
821 } 821 }
822 822
823 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info) 823 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall backInfo<v8::Value>& info)
824 { 824 {
825 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 825 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
826 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod (info); 826 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod (info);
827 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 827 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
828 } 828 }
829 829
830 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) 830 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info)
831 { 831 {
832 if (UNLIKELY(info.Length() < 2)) { 832 if (UNLIKELY(info.Length() < 2)) {
833 throwArityTypeErrorForMethod("voidMethodDoubleArgFloatArg", "TestInterfa ce", 2, info.Length(), info.GetIsolate()); 833 throwMinimumArityTypeErrorForMethod("voidMethodDoubleArgFloatArg", "Test Interface", 2, info.Length(), info.GetIsolate());
834 return; 834 return;
835 } 835 }
836 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 836 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
837 TONATIVE_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue()) ); 837 TONATIVE_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue()) );
838 if (!std::isfinite(doubleArg)) { 838 if (!std::isfinite(doubleArg)) {
839 throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFl oatArg", "TestInterface", "double parameter 1 is non-finite."), info.GetIsolate( )); 839 throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFl oatArg", "TestInterface", "double parameter 1 is non-finite."), info.GetIsolate( ));
840 return; 840 return;
841 } 841 }
842 TONATIVE_VOID(float, floatArg, static_cast<float>(info[1]->NumberValue())); 842 TONATIVE_VOID(float, floatArg, static_cast<float>(info[1]->NumberValue()));
843 if (!std::isfinite(floatArg)) { 843 if (!std::isfinite(floatArg)) {
844 throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFl oatArg", "TestInterface", "float parameter 2 is non-finite."), info.GetIsolate() ); 844 throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFl oatArg", "TestInterface", "float parameter 2 is non-finite."), info.GetIsolate() );
845 return; 845 return;
846 } 846 }
847 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); 847 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg);
848 } 848 }
849 849
850 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info) 850 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallback Info<v8::Value>& info)
851 { 851 {
852 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 852 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
853 TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(inf o); 853 TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(inf o);
854 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 854 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
855 } 855 }
856 856
857 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info) 857 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info)
858 { 858 {
859 if (UNLIKELY(info.Length() < 2)) { 859 if (UNLIKELY(info.Length() < 2)) {
860 throwArityTypeErrorForMethod("voidMethodUnrestrictedDoubleArgUnrestricte dFloatArg", "TestInterface", 2, info.Length(), info.GetIsolate()); 860 throwMinimumArityTypeErrorForMethod("voidMethodUnrestrictedDoubleArgUnre strictedFloatArg", "TestInterface", 2, info.Length(), info.GetIsolate());
861 return; 861 return;
862 } 862 }
863 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 863 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
864 TONATIVE_VOID(double, unrestrictedDoubleArg, static_cast<double>(info[0]->Nu mberValue())); 864 TONATIVE_VOID(double, unrestrictedDoubleArg, static_cast<double>(info[0]->Nu mberValue()));
865 TONATIVE_VOID(float, unrestrictedFloatArg, static_cast<float>(info[1]->Numbe rValue())); 865 TONATIVE_VOID(float, unrestrictedFloatArg, static_cast<float>(info[1]->Numbe rValue()));
866 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDouble Arg, unrestrictedFloatArg); 866 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDouble Arg, unrestrictedFloatArg);
867 } 867 }
868 868
869 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info) 869 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info)
870 { 870 {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 { 909 {
910 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 910 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
911 TestInterfaceImplementationV8Internal::implementsVoidMethodMethod(info); 911 TestInterfaceImplementationV8Internal::implementsVoidMethodMethod(info);
912 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 912 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
913 } 913 }
914 914
915 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info) 915 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info)
916 { 916 {
917 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); 917 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC omplexMethod", "TestInterface", info.Holder(), info.GetIsolate());
918 if (UNLIKELY(info.Length() < 2)) { 918 if (UNLIKELY(info.Length() < 2)) {
919 throwArityTypeError(exceptionState, 2, info.Length()); 919 throwMinimumArityTypeError(exceptionState, 2, info.Length());
920 return; 920 return;
921 } 921 }
922 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 922 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
923 TOSTRING_VOID(V8StringResource<>, strArg, info[0]); 923 TOSTRING_VOID(V8StringResource<>, strArg, info[0]);
924 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], info.Ge tIsolate())) { 924 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], info.Ge tIsolate())) {
925 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterface Empty'."); 925 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterface Empty'.");
926 exceptionState.throwIfNeeded(); 926 exceptionState.throwIfNeeded();
927 return; 927 return;
928 } 928 }
929 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[1])); 929 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethod(info); 1032 TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethod(info);
1033 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1033 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1034 } 1034 }
1035 #endif // ENABLE(PARTIAL_CONDITION) 1035 #endif // ENABLE(PARTIAL_CONDITION)
1036 1036
1037 #if ENABLE(PARTIAL_CONDITION) 1037 #if ENABLE(PARTIAL_CONDITION)
1038 static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Va lue>& info) 1038 static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Va lue>& info)
1039 { 1039 {
1040 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoid MethodLongArg", "TestInterface", info.Holder(), info.GetIsolate()); 1040 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoid MethodLongArg", "TestInterface", info.Holder(), info.GetIsolate());
1041 if (UNLIKELY(info.Length() < 1)) { 1041 if (UNLIKELY(info.Length() < 1)) {
1042 throwArityTypeError(exceptionState, 1, info.Length()); 1042 throwMinimumArityTypeError(exceptionState, 1, info.Length());
1043 return; 1043 return;
1044 } 1044 }
1045 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 1045 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
1046 TONATIVE_VOID_EXCEPTIONSTATE(int, longArg, toInt32(info[0], exceptionState), exceptionState); 1046 TONATIVE_VOID_EXCEPTIONSTATE(int, longArg, toInt32(info[0], exceptionState), exceptionState);
1047 ASSERT(impl); 1047 ASSERT(impl);
1048 TestPartialInterface::partialVoidMethodLongArg(*impl, longArg); 1048 TestPartialInterface::partialVoidMethodLongArg(*impl, longArg);
1049 } 1049 }
1050 #endif // ENABLE(PARTIAL_CONDITION) 1050 #endif // ENABLE(PARTIAL_CONDITION)
1051 1051
1052 #if ENABLE(PARTIAL_CONDITION) 1052 #if ENABLE(PARTIAL_CONDITION)
(...skipping 24 matching lines...) Expand all
1077 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 1077 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1078 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaises ExceptionVoidMethodMethod(info); 1078 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaises ExceptionVoidMethodMethod(info);
1079 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 1079 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1080 } 1080 }
1081 #endif // ENABLE(PARTIAL_CONDITION) 1081 #endif // ENABLE(PARTIAL_CONDITION)
1082 1082
1083 #if ENABLE(PARTIAL_CONDITION) 1083 #if ENABLE(PARTIAL_CONDITION)
1084 static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCall backInfo<v8::Value>& info) 1084 static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCall backInfo<v8::Value>& info)
1085 { 1085 {
1086 if (UNLIKELY(info.Length() < 1)) { 1086 if (UNLIKELY(info.Length() < 1)) {
1087 throwArityTypeErrorForMethod("partialVoidMethodPartialCallbackTypeArg", "TestInterface", 1, info.Length(), info.GetIsolate()); 1087 throwMinimumArityTypeErrorForMethod("partialVoidMethodPartialCallbackTyp eArg", "TestInterface", 1, info.Length(), info.GetIsolate());
1088 return; 1088 return;
1089 } 1089 }
1090 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 1090 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
1091 TONATIVE_VOID(ScriptValue, partialCallbackTypeArg, ScriptValue(ScriptState:: current(info.GetIsolate()), info[0])); 1091 TONATIVE_VOID(ScriptValue, partialCallbackTypeArg, ScriptValue(ScriptState:: current(info.GetIsolate()), info[0]));
1092 ASSERT(impl); 1092 ASSERT(impl);
1093 TestPartialInterface::partialVoidMethodPartialCallbackTypeArg(*impl, partial CallbackTypeArg); 1093 TestPartialInterface::partialVoidMethodPartialCallbackTypeArg(*impl, partial CallbackTypeArg);
1094 } 1094 }
1095 #endif // ENABLE(PARTIAL_CONDITION) 1095 #endif // ENABLE(PARTIAL_CONDITION)
1096 1096
1097 #if ENABLE(PARTIAL_CONDITION) 1097 #if ENABLE(PARTIAL_CONDITION)
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 } 1493 }
1494 1494
1495 template<> 1495 template<>
1496 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate) 1496 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle <v8::Object> creationContext, v8::Isolate* isolate)
1497 { 1497 {
1498 return toV8(impl, creationContext, isolate); 1498 return toV8(impl, creationContext, isolate);
1499 } 1499 }
1500 1500
1501 } // namespace WebCore 1501 } // namespace WebCore
1502 #endif // ENABLE(CONDITION) 1502 #endif // ENABLE(CONDITION)
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/bindings/tests/results/V8TestInterface2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698