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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceConstructor.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 #include "V8TestInterfaceConstructor.h" 8 #include "V8TestInterfaceConstructor.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstructo r", "No matching constructor signature."), info.GetIsolate()); 107 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstructo r", "No matching constructor signature."), info.GetIsolate());
108 } 108 }
109 109
110 } // namespace TestInterfaceConstructorV8Internal 110 } // namespace TestInterfaceConstructorV8Internal
111 111
112 void V8TestInterfaceConstructor::constructorCallback(const v8::FunctionCallbackI nfo<v8::Value>& info) 112 void V8TestInterfaceConstructor::constructorCallback(const v8::FunctionCallbackI nfo<v8::Value>& info)
113 { 113 {
114 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); 114 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
115 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::Te stFeature); 115 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::Te stFeature);
116 if (!info.IsConstructCall()) { 116 if (!info.IsConstructCall()) {
117 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceConstr uctor", "Please use the 'new' operator, this DOM object constructor cannot be ca lled as a function."), info.GetIsolate()); 117 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test InterfaceConstructor"), info.GetIsolate());
118 return; 118 return;
119 } 119 }
120 120
121 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { 121 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
122 v8SetReturnValue(info, info.Holder()); 122 v8SetReturnValue(info, info.Holder());
123 return; 123 return;
124 } 124 }
125 125
126 TestInterfaceConstructorV8Internal::constructor(info); 126 TestInterfaceConstructorV8Internal::constructor(info);
127 } 127 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 fromInternalPointer(object)->deref(); 199 fromInternalPointer(object)->deref();
200 } 200 }
201 201
202 template<> 202 template<>
203 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 203 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
204 { 204 {
205 return toV8(impl, creationContext, isolate); 205 return toV8(impl, creationContext, isolate);
206 } 206 }
207 207
208 } // namespace WebCore 208 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/tests/results/V8TestInterfaceConstructor2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698