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

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

Issue 24203002: Improve generated "Not enough arguments." TypeError exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 7 years, 3 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 /* 1 /*
2 This file is part of the Blink open source project. 2 This file is part of the Blink open source project.
3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY!
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "V8TestActiveDOMObject.h" 22 #include "V8TestActiveDOMObject.h"
23 23
24 #include "RuntimeEnabledFeatures.h" 24 #include "RuntimeEnabledFeatures.h"
25 #include "V8Node.h" 25 #include "V8Node.h"
26 #include "bindings/v8/BindingSecurity.h" 26 #include "bindings/v8/BindingSecurity.h"
27 #include "bindings/v8/ExceptionMessages.h"
27 #include "bindings/v8/ExceptionState.h" 28 #include "bindings/v8/ExceptionState.h"
28 #include "bindings/v8/ScriptController.h" 29 #include "bindings/v8/ScriptController.h"
29 #include "bindings/v8/V8Binding.h" 30 #include "bindings/v8/V8Binding.h"
30 #include "bindings/v8/V8DOMConfiguration.h" 31 #include "bindings/v8/V8DOMConfiguration.h"
31 #include "bindings/v8/V8DOMWrapper.h" 32 #include "bindings/v8/V8DOMWrapper.h"
32 #include "core/dom/ContextFeatures.h" 33 #include "core/dom/ContextFeatures.h"
33 #include "core/dom/Document.h" 34 #include "core/dom/Document.h"
34 #include "core/platform/chromium/TraceEvent.h" 35 #include "core/platform/chromium/TraceEvent.h"
35 #include "wtf/UnusedParam.h" 36 #include "wtf/UnusedParam.h"
36 37
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 85
85 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8 ::AccessType type, v8::Local<v8::Value>) 86 bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8 ::AccessType type, v8::Local<v8::Value>)
86 { 87 {
87 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(host); 88 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(host);
88 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe curityError); 89 return BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSe curityError);
89 } 90 }
90 91
91 static void excitingFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs) 92 static void excitingFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& ar gs)
92 { 93 {
93 if (UNLIKELY(args.Length() < 1)) { 94 if (UNLIKELY(args.Length() < 1)) {
94 throwNotEnoughArgumentsError(args.GetIsolate()); 95 throwTypeError(ExceptionMessages::failedToExecute("excitingFunction", "T estActiveDOMObject", ExceptionMessages::notEnoughArguments(1, args.Length())), a rgs.GetIsolate());
95 return; 96 return;
96 } 97 }
97 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder()); 98 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder());
98 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame())) 99 if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame()))
99 return; 100 return;
100 V8TRYCATCH_VOID(Node*, nextChild, V8Node::HasInstance(args[0], args.GetIsola te(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::C ast(args[0])) : 0); 101 V8TRYCATCH_VOID(Node*, nextChild, V8Node::HasInstance(args[0], args.GetIsola te(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::C ast(args[0])) : 0);
101 imp->excitingFunction(nextChild); 102 imp->excitingFunction(nextChild);
102 103
103 return; 104 return;
104 } 105 }
105 106
106 static void excitingFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args) 107 static void excitingFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& args)
107 { 108 {
108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 109 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
109 TestActiveDOMObjectV8Internal::excitingFunctionMethod(args); 110 TestActiveDOMObjectV8Internal::excitingFunctionMethod(args);
110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 111 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
111 } 112 }
112 113
113 static void postMessageMethod(const v8::FunctionCallbackInfo<v8::Value>& args) 114 static void postMessageMethod(const v8::FunctionCallbackInfo<v8::Value>& args)
114 { 115 {
115 if (UNLIKELY(args.Length() < 1)) { 116 if (UNLIKELY(args.Length() < 1)) {
116 throwNotEnoughArgumentsError(args.GetIsolate()); 117 throwTypeError(ExceptionMessages::failedToExecute("postMessage", "TestAc tiveDOMObject", ExceptionMessages::notEnoughArguments(1, args.Length())), args.G etIsolate());
117 return; 118 return;
118 } 119 }
119 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder()); 120 TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder());
120 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, message, args[0]); 121 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, message, args[0]);
121 imp->postMessage(message); 122 imp->postMessage(message);
122 123
123 return; 124 return;
124 } 125 }
125 126
126 static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args) 127 static void postMessageMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& args)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 V8DOMWrapper::associateObjectWithWrapper<V8TestActiveDOMObject>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent); 263 V8DOMWrapper::associateObjectWithWrapper<V8TestActiveDOMObject>(impl, &info, wrapper, isolate, WrapperConfiguration::Independent);
263 return wrapper; 264 return wrapper;
264 } 265 }
265 266
266 void V8TestActiveDOMObject::derefObject(void* object) 267 void V8TestActiveDOMObject::derefObject(void* object)
267 { 268 {
268 fromInternalPointer(object)->deref(); 269 fromInternalPointer(object)->deref();
269 } 270 }
270 271
271 } // namespace WebCore 272 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8Float64Array.cpp ('k') | Source/bindings/tests/results/V8TestCustomAccessors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698