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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceCustomConstructor.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 "V8TestInterfaceCustomConstructor.h" 8 #include "V8TestInterfaceCustomConstructor.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 namespace TestInterfaceCustomConstructorV8Internal { 42 namespace TestInterfaceCustomConstructorV8Internal {
43 43
44 template <typename T> void V8_USE(T) { } 44 template <typename T> void V8_USE(T) { }
45 45
46 } // namespace TestInterfaceCustomConstructorV8Internal 46 } // namespace TestInterfaceCustomConstructorV8Internal
47 47
48 void V8TestInterfaceCustomConstructor::constructorCallback(const v8::FunctionCal lbackInfo<v8::Value>& info) 48 void V8TestInterfaceCustomConstructor::constructorCallback(const v8::FunctionCal lbackInfo<v8::Value>& info)
49 { 49 {
50 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); 50 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
51 if (!info.IsConstructCall()) { 51 if (!info.IsConstructCall()) {
52 throwTypeError(ExceptionMessages::failedToConstruct("TestInterfaceCustom Constructor", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate()); 52 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test InterfaceCustomConstructor"), info.GetIsolate());
53 return; 53 return;
54 } 54 }
55 55
56 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { 56 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
57 v8SetReturnValue(info, info.Holder()); 57 v8SetReturnValue(info, info.Holder());
58 return; 58 return;
59 } 59 }
60 60
61 V8TestInterfaceCustomConstructor::constructorCustom(info); 61 V8TestInterfaceCustomConstructor::constructorCustom(info);
62 } 62 }
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 fromInternalPointer(object)->deref(); 134 fromInternalPointer(object)->deref();
135 } 135 }
136 136
137 template<> 137 template<>
138 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCustomConstructor* impl, v8::Han dle<v8::Object> creationContext, v8::Isolate* isolate) 138 v8::Handle<v8::Value> toV8NoInline(TestInterfaceCustomConstructor* impl, v8::Han dle<v8::Object> creationContext, v8::Isolate* isolate)
139 { 139 {
140 return toV8(impl, creationContext, isolate); 140 return toV8(impl, creationContext, isolate);
141 } 141 }
142 142
143 } // namespace WebCore 143 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698