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

Side by Side Diff: Source/bindings/v8/ExceptionMessages.cpp

Issue 284163002: Better arity checks for overloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return properly Created 6 years, 7 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
« no previous file with comments | « Source/bindings/v8/ExceptionMessages.h ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 String ExceptionMessages::constructorNotCallableAsFunction(const char* type) 84 String ExceptionMessages::constructorNotCallableAsFunction(const char* type)
85 { 85 {
86 return failedToConstruct(type, "Please use the 'new' operator, this DOM obje ct constructor cannot be called as a function."); 86 return failedToConstruct(type, "Please use the 'new' operator, this DOM obje ct constructor cannot be called as a function.");
87 } 87 }
88 88
89 String ExceptionMessages::incorrectPropertyType(const String& property, const St ring& detail) 89 String ExceptionMessages::incorrectPropertyType(const String& property, const St ring& detail)
90 { 90 {
91 return "The '" + property + "' property " + detail; 91 return "The '" + property + "' property " + detail;
92 } 92 }
93 93
94 String ExceptionMessages::invalidArity(const char* expected, unsigned provided)
95 {
96 return "Valid arities are: " + String(expected) + ", but " + String::number( provided) + " arguments provided.";
97 }
98
94 String ExceptionMessages::argumentNullOrIncorrectType(int argumentIndex, const S tring& expectedType) 99 String ExceptionMessages::argumentNullOrIncorrectType(int argumentIndex, const S tring& expectedType)
95 { 100 {
96 return "The " + ordinalNumber(argumentIndex) + " argument provided is either null, or an invalid " + expectedType + " object."; 101 return "The " + ordinalNumber(argumentIndex) + " argument provided is either null, or an invalid " + expectedType + " object.";
97 } 102 }
98 103
99 String ExceptionMessages::notAnArrayTypeArgumentOrValue(int argumentIndex) 104 String ExceptionMessages::notAnArrayTypeArgumentOrValue(int argumentIndex)
100 { 105 {
101 String kind; 106 String kind;
102 if (argumentIndex) // method argument 107 if (argumentIndex) // method argument
103 kind = ordinalNumber(argumentIndex) + " argument"; 108 kind = ordinalNumber(argumentIndex) + " argument";
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return formatPotentiallyNonFiniteNumber(number); 165 return formatPotentiallyNonFiniteNumber(number);
161 } 166 }
162 167
163 template <> 168 template <>
164 String ExceptionMessages::formatNumber<double>(double number) 169 String ExceptionMessages::formatNumber<double>(double number)
165 { 170 {
166 return formatPotentiallyNonFiniteNumber(number); 171 return formatPotentiallyNonFiniteNumber(number);
167 } 172 }
168 173
169 } // namespace WebCore 174 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ExceptionMessages.h ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698