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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceNamedConstructor.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 "V8TestInterfaceNamedConstructor.h" 8 #include "V8TestInterfaceNamedConstructor.h"
9 9
10 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNamedCons tructorAttributes[] = { 68 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceNamedCons tructorAttributes[] = {
69 {"testNamedConstructorConstructorAttribute", TestInterfaceNamedConstructorV8 Internal::TestInterfaceNamedConstructorConstructorGetter, TestInterfaceNamedCons tructorV8Internal::TestInterfaceNamedConstructorReplaceableAttributeSetterCallba ck, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestNamedConstructor::wrapperTypeInfo) , static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute >(v8::DontEnum), 0 /* on instance */}, 69 {"testNamedConstructorConstructorAttribute", TestInterfaceNamedConstructorV8 Internal::TestInterfaceNamedConstructorConstructorGetter, TestInterfaceNamedCons tructorV8Internal::TestInterfaceNamedConstructorReplaceableAttributeSetterCallba ck, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestNamedConstructor::wrapperTypeInfo) , static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute >(v8::DontEnum), 0 /* on instance */},
70 }; 70 };
71 71
72 const WrapperTypeInfo V8TestInterfaceNamedConstructorConstructor::wrapperTypeInf o = { gin::kEmbedderBlink, V8TestInterfaceNamedConstructorConstructor::domTempla te, V8TestInterfaceNamedConstructor::derefObject, V8TestInterfaceNamedConstructo r::toActiveDOMObject, 0, 0, V8TestInterfaceNamedConstructor::installPerContextEn abledMethods, 0, WrapperTypeObjectPrototype, false }; 72 const WrapperTypeInfo V8TestInterfaceNamedConstructorConstructor::wrapperTypeInf o = { gin::kEmbedderBlink, V8TestInterfaceNamedConstructorConstructor::domTempla te, V8TestInterfaceNamedConstructor::derefObject, V8TestInterfaceNamedConstructo r::toActiveDOMObject, 0, 0, V8TestInterfaceNamedConstructor::installPerContextEn abledMethods, 0, WrapperTypeObjectPrototype, false };
73 73
74 static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio nCallbackInfo<v8::Value>& info) 74 static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::Functio nCallbackInfo<v8::Value>& info)
75 { 75 {
76 if (!info.IsConstructCall()) { 76 if (!info.IsConstructCall()) {
77 throwTypeError(ExceptionMessages::failedToConstruct("Audio", "Please use the 'new' operator, this DOM object constructor cannot be called as a function. "), info.GetIsolate()); 77 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Audi o"), info.GetIsolate());
78 return; 78 return;
79 } 79 }
80 80
81 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { 81 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
82 v8SetReturnValue(info, info.Holder()); 82 v8SetReturnValue(info, info.Holder());
83 return; 83 return;
84 } 84 }
85 85
86 Document* document = currentDOMWindow(info.GetIsolate())->document(); 86 Document* document = currentDOMWindow(info.GetIsolate())->document();
87 ASSERT(document); 87 ASSERT(document);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 fromInternalPointer(object)->deref(); 204 fromInternalPointer(object)->deref();
205 } 205 }
206 206
207 template<> 207 template<>
208 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate) 208 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Hand le<v8::Object> creationContext, v8::Isolate* isolate)
209 { 209 {
210 return toV8(impl, creationContext, isolate); 210 return toV8(impl, creationContext, isolate);
211 } 211 }
212 212
213 } // namespace WebCore 213 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698