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

Unified Diff: Source/bindings/v8/ExceptionMessages.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/ExceptionMessages.h ('k') | Source/bindings/v8/V8ThrowException.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ExceptionMessages.cpp
diff --git a/Source/bindings/v8/ExceptionMessages.cpp b/Source/bindings/v8/ExceptionMessages.cpp
index 0309f1dd5b723e7b4d9f15c515bf08b5e9ad0e23..f8d6a55e0d623c178c644077b30c94c19f050eb3 100644
--- a/Source/bindings/v8/ExceptionMessages.cpp
+++ b/Source/bindings/v8/ExceptionMessages.cpp
@@ -33,6 +33,11 @@
namespace WebCore {
+String ExceptionMessages::failedToConstruct(const String& type, const String& detail)
+{
+ return "Failed to construct '" + type + (!detail.isEmpty() ? String("': " + detail) : String("'"));
+}
+
String ExceptionMessages::failedToExecute(const String& method, const String& type, const String& detail)
{
return "Failed to execute '" + method + "' on '" + type + (!detail.isEmpty() ? String("': " + detail) : String("'"));
@@ -48,4 +53,9 @@ String ExceptionMessages::failedToSet(const String& property, const String& type
return "Failed to set the '" + property + "' property on '" + type + "': " + detail;
}
+String ExceptionMessages::notEnoughArguments(unsigned expected, unsigned provided)
+{
+ return String::number(expected) + " argument" + (expected > 1 ? "s" : "") + " required, but only " + String::number(provided) + " present.";
+}
+
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/ExceptionMessages.h ('k') | Source/bindings/v8/V8ThrowException.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698