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

Side by Side Diff: Source/bindings/tests/results/V8TestNamedConstructor.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 "V8TestNamedConstructor.h" 22 #include "V8TestNamedConstructor.h"
23 23
24 #include "RuntimeEnabledFeatures.h" 24 #include "RuntimeEnabledFeatures.h"
25 #include "V8Document.h" 25 #include "V8Document.h"
26 #include "bindings/v8/ExceptionMessages.h"
26 #include "bindings/v8/ExceptionState.h" 27 #include "bindings/v8/ExceptionState.h"
27 #include "bindings/v8/ScriptController.h" 28 #include "bindings/v8/ScriptController.h"
28 #include "bindings/v8/V8Binding.h" 29 #include "bindings/v8/V8Binding.h"
29 #include "bindings/v8/V8DOMConfiguration.h" 30 #include "bindings/v8/V8DOMConfiguration.h"
30 #include "bindings/v8/V8DOMWrapper.h" 31 #include "bindings/v8/V8DOMWrapper.h"
31 #include "bindings/v8/V8ObjectConstructor.h" 32 #include "bindings/v8/V8ObjectConstructor.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"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 80 }
80 81
81 Document* document = currentDocument(); 82 Document* document = currentDocument();
82 ASSERT(document); 83 ASSERT(document);
83 84
84 // Make sure the document is added to the DOM Node map. Otherwise, the TestN amedConstructor instance 85 // Make sure the document is added to the DOM Node map. Otherwise, the TestN amedConstructor instance
85 // may end up being the only node in the map and get garbage-collected prema turely. 86 // may end up being the only node in the map and get garbage-collected prema turely.
86 toV8(document, args.Holder(), args.GetIsolate()); 87 toV8(document, args.Holder(), args.GetIsolate());
87 88
88 if (UNLIKELY(args.Length() < 1)) { 89 if (UNLIKELY(args.Length() < 1)) {
89 throwNotEnoughArgumentsError(args.GetIsolate()); 90 throwTypeError(ExceptionMessages::failedToExecute("NamedConstructor", "T estNamedConstructor", ExceptionMessages::notEnoughArguments(1, args.Length())), args.GetIsolate());
90 return; 91 return;
91 } 92 }
92 ExceptionState es(args.GetIsolate()); 93 ExceptionState es(args.GetIsolate());
93 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, args[0]); 94 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, args[0]);
94 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, args[1]); 95 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, args[1]);
95 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul l(args, 2)); 96 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNul l(args, 2));
96 97
97 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru ctor(*document, str1, str2, str3, es); 98 RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstru ctor(*document, str1, str2, str3, es);
98 v8::Handle<v8::Object> wrapper = args.Holder(); 99 v8::Handle<v8::Object> wrapper = args.Holder();
99 if (es.throwIfNeeded()) 100 if (es.throwIfNeeded())
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl, &info , wrapper, isolate, WrapperConfiguration::Dependent); 192 V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl, &info , wrapper, isolate, WrapperConfiguration::Dependent);
192 return wrapper; 193 return wrapper;
193 } 194 }
194 195
195 void V8TestNamedConstructor::derefObject(void* object) 196 void V8TestNamedConstructor::derefObject(void* object)
196 { 197 {
197 fromInternalPointer(object)->deref(); 198 fromInternalPointer(object)->deref();
198 } 199 }
199 200
200 } // namespace WebCore 201 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestMediaQueryListListener.cpp ('k') | Source/bindings/tests/results/V8TestObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698