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

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

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
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 result.append(") is outside the range "); 112 result.append(") is outside the range ");
113 result.append(lowerType == ExclusiveBound ? '(' : '['); 113 result.append(lowerType == ExclusiveBound ? '(' : '[');
114 result.append(formatNumber(lowerBound)); 114 result.append(formatNumber(lowerBound));
115 result.append(", "); 115 result.append(", ");
116 result.append(formatNumber(upperBound)); 116 result.append(formatNumber(upperBound));
117 result.append(upperType == ExclusiveBound ? ')' : ']'); 117 result.append(upperType == ExclusiveBound ? ')' : ']');
118 result.append('.'); 118 result.append('.');
119 return result.toString(); 119 return result.toString();
120 } 120 }
121 121
122 static String invalidArity(const char* expected, unsigned provided);
123
122 // If > 0, the argument index that failed type check (1-indexed.) 124 // If > 0, the argument index that failed type check (1-indexed.)
123 // If == 0, a (non-argument) value (e.g., a setter) failed the same check. 125 // If == 0, a (non-argument) value (e.g., a setter) failed the same check.
124 static String notAnArrayTypeArgumentOrValue(int argumentIndex); 126 static String notAnArrayTypeArgumentOrValue(int argumentIndex);
125 static String notASequenceTypeProperty(const String& propertyName); 127 static String notASequenceTypeProperty(const String& propertyName);
126 static String notAFiniteNumber(double value, const char* name = "value provi ded"); 128 static String notAFiniteNumber(double value, const char* name = "value provi ded");
127 static String notAFiniteNumber(const Decimal& value, const char* name = "val ue provided"); 129 static String notAFiniteNumber(const Decimal& value, const char* name = "val ue provided");
128 130
129 static String notEnoughArguments(unsigned expected, unsigned providedleastNu mMandatoryParams); 131 static String notEnoughArguments(unsigned expected, unsigned providedleastNu mMandatoryParams);
130 132
131 static String readOnly(const char* detail = 0); 133 static String readOnly(const char* detail = 0);
(...skipping 21 matching lines...) Expand all
153 155
154 static String ordinalNumber(int number); 156 static String ordinalNumber(int number);
155 }; 157 };
156 158
157 template <> String ExceptionMessages::formatNumber<float>(float number); 159 template <> String ExceptionMessages::formatNumber<float>(float number);
158 template <> String ExceptionMessages::formatNumber<double>(double number); 160 template <> String ExceptionMessages::formatNumber<double>(double number);
159 161
160 } // namespace WebCore 162 } // namespace WebCore
161 163
162 #endif // ExceptionMessages_h 164 #endif // ExceptionMessages_h
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestTypedefs.cpp ('k') | Source/bindings/v8/ExceptionMessages.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698