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

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

Issue 211333004: Tidy up error reporting for calling-constructor-as-function. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: re-use failedToConstruct() in constructorNotCallableAsFunction(). Created 6 years, 9 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
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(Condition1) || ENABLE(Condition2) 8 #if ENABLE(Condition1) || ENABLE(Condition2)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 #endif // ENABLE(CONDITION_PARTIAL) 740 #endif // ENABLE(CONDITION_PARTIAL)
741 #if ENABLE(CONDITION_PARTIAL) 741 #if ENABLE(CONDITION_PARTIAL)
742 {"supplementalMethod3", TestInterfaceV8Internal::supplementalMethod3MethodCa llback, 0, 0}, 742 {"supplementalMethod3", TestInterfaceV8Internal::supplementalMethod3MethodCa llback, 0, 0},
743 #endif // ENABLE(CONDITION_PARTIAL) 743 #endif // ENABLE(CONDITION_PARTIAL)
744 }; 744 };
745 745
746 void V8TestInterface::constructorCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) 746 void V8TestInterface::constructorCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info)
747 { 747 {
748 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); 748 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
749 if (!info.IsConstructCall()) { 749 if (!info.IsConstructCall()) {
750 throwTypeError(ExceptionMessages::failedToConstruct("TestInterface", "Pl ease use the 'new' operator, this DOM object constructor cannot be called as a f unction."), info.GetIsolate()); 750 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test Interface"), info.GetIsolate());
751 return; 751 return;
752 } 752 }
753 753
754 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { 754 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
755 v8SetReturnValue(info, info.Holder()); 755 v8SetReturnValue(info, info.Holder());
756 return; 756 return;
757 } 757 }
758 758
759 TestInterfaceV8Internal::constructor(info); 759 TestInterfaceV8Internal::constructor(info);
760 } 760 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 } 884 }
885 885
886 template<> 886 template<>
887 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 887 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
888 { 888 {
889 return toV8(impl, creationContext, isolate); 889 return toV8(impl, creationContext, isolate);
890 } 890 }
891 891
892 } // namespace WebCore 892 } // namespace WebCore
893 #endif // ENABLE(Condition1) || ENABLE(Condition2) 893 #endif // ENABLE(Condition1) || ENABLE(Condition2)
OLDNEW
« no previous file with comments | « Source/bindings/templates/methods.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698