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

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

Issue 211333004: Tidy up error reporting for calling-constructor-as-function. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: re-use failedToConstruct() in constructorNotCallableAsFunction(). Created 6 years, 9 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
« no previous file with comments | « Source/bindings/v8/ExceptionMessages.h ('k') | no next file » | 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 String ExceptionMessages::failedToSetIndexed(const String& type, const String& d etail) 74 String ExceptionMessages::failedToSetIndexed(const String& type, const String& d etail)
75 { 75 {
76 return "Failed to set an indexed property on '" + type + "': " + detail; 76 return "Failed to set an indexed property on '" + type + "': " + detail;
77 } 77 }
78 78
79 String ExceptionMessages::failedToDeleteIndexed(const String& type, const String & detail) 79 String ExceptionMessages::failedToDeleteIndexed(const String& type, const String & detail)
80 { 80 {
81 return "Failed to delete an indexed property from '" + type + "': " + detail ; 81 return "Failed to delete an indexed property from '" + type + "': " + detail ;
82 } 82 }
83 83
84 String ExceptionMessages::constructorNotCallableAsFunction(const String& type)
85 {
86 return failedToConstruct(type, "Please use the 'new' operator, this DOM obje ct constructor cannot be called as a function.");
87 }
88
84 String ExceptionMessages::incorrectPropertyType(const String& property, const St ring& detail) 89 String ExceptionMessages::incorrectPropertyType(const String& property, const St ring& detail)
85 { 90 {
86 return "The '" + property + "' property " + detail; 91 return "The '" + property + "' property " + detail;
87 } 92 }
88 93
89 String ExceptionMessages::argumentNullOrIncorrectType(int argumentIndex, const S tring& expectedType) 94 String ExceptionMessages::argumentNullOrIncorrectType(int argumentIndex, const S tring& expectedType)
90 { 95 {
91 return "The " + ordinalNumber(argumentIndex) + " argument provided is either null, or an invalid " + expectedType + " object."; 96 return "The " + ordinalNumber(argumentIndex) + " argument provided is either null, or an invalid " + expectedType + " object.";
92 } 97 }
93 98
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return formatPotentiallyNonFiniteNumber(number); 160 return formatPotentiallyNonFiniteNumber(number);
156 } 161 }
157 162
158 template <> 163 template <>
159 String ExceptionMessages::formatNumber<double>(double number) 164 String ExceptionMessages::formatNumber<double>(double number)
160 { 165 {
161 return formatPotentiallyNonFiniteNumber(number); 166 return formatPotentiallyNonFiniteNumber(number);
162 } 167 }
163 168
164 } // namespace WebCore 169 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ExceptionMessages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698