| OLD | NEW |
| 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 23 matching lines...) Expand all Loading... |
| 34 #include "platform/Decimal.h" | 34 #include "platform/Decimal.h" |
| 35 #include "wtf/MathExtras.h" | 35 #include "wtf/MathExtras.h" |
| 36 | 36 |
| 37 namespace WebCore { | 37 namespace WebCore { |
| 38 | 38 |
| 39 String ExceptionMessages::failedToConstruct(const String& type, const String& de
tail) | 39 String ExceptionMessages::failedToConstruct(const String& type, const String& de
tail) |
| 40 { | 40 { |
| 41 return "Failed to construct '" + type + (!detail.isEmpty() ? String("': " +
detail) : String("'")); | 41 return "Failed to construct '" + type + (!detail.isEmpty() ? String("': " +
detail) : String("'")); |
| 42 } | 42 } |
| 43 | 43 |
| 44 String ExceptionMessages::failedToEnumerate(const String& type, const String& de
tail) |
| 45 { |
| 46 return "Failed to enumerate the properties of '" + type + (!detail.isEmpty()
? String("': " + detail) : String("'")); |
| 47 } |
| 48 |
| 44 String ExceptionMessages::failedToExecute(const String& method, const String& ty
pe, const String& detail) | 49 String ExceptionMessages::failedToExecute(const String& method, const String& ty
pe, const String& detail) |
| 45 { | 50 { |
| 46 return "Failed to execute '" + method + "' on '" + type + (!detail.isEmpty()
? String("': " + detail) : String("'")); | 51 return "Failed to execute '" + method + "' on '" + type + (!detail.isEmpty()
? String("': " + detail) : String("'")); |
| 47 } | 52 } |
| 48 | 53 |
| 49 String ExceptionMessages::failedToGet(const String& property, const String& type
, const String& detail) | 54 String ExceptionMessages::failedToGet(const String& property, const String& type
, const String& detail) |
| 50 { | 55 { |
| 51 return "Failed to read the '" + property + "' property from '" + type + "':
" + detail; | 56 return "Failed to read the '" + property + "' property from '" + type + "':
" + detail; |
| 52 } | 57 } |
| 53 | 58 |
| 54 String ExceptionMessages::failedToSet(const String& property, const String& type
, const String& detail) | 59 String ExceptionMessages::failedToSet(const String& property, const String& type
, const String& detail) |
| 55 { | 60 { |
| 56 return "Failed to set the '" + property + "' property on '" + type + "': " +
detail; | 61 return "Failed to set the '" + property + "' property on '" + type + "': " +
detail; |
| 57 } | 62 } |
| 58 | 63 |
| 59 String ExceptionMessages::failedToDelete(const String& property, const String& t
ype, const String& detail) | 64 String ExceptionMessages::failedToDelete(const String& property, const String& t
ype, const String& detail) |
| 60 { | 65 { |
| 61 return "Failed to delete the '" + property + "' property from '" + type + "'
: " + detail; | 66 return "Failed to delete the '" + property + "' property from '" + type + "'
: " + detail; |
| 62 } | 67 } |
| 63 | 68 |
| 69 String ExceptionMessages::failedToGetIndexed(const String& type, const String& d
etail) |
| 70 { |
| 71 return "Failed to read an indexed property from '" + type + "': " + detail; |
| 72 } |
| 73 |
| 74 String ExceptionMessages::failedToSetIndexed(const String& type, const String& d
etail) |
| 75 { |
| 76 return "Failed to set an indexed property on '" + type + "': " + detail; |
| 77 } |
| 78 |
| 79 String ExceptionMessages::failedToDeleteIndexed(const String& type, const String
& detail) |
| 80 { |
| 81 return "Failed to delete an indexed property from '" + type + "': " + detail
; |
| 82 } |
| 83 |
| 64 String ExceptionMessages::incorrectPropertyType(const String& property, const St
ring& detail) | 84 String ExceptionMessages::incorrectPropertyType(const String& property, const St
ring& detail) |
| 65 { | 85 { |
| 66 return "The '" + property + "' property " + detail; | 86 return "The '" + property + "' property " + detail; |
| 67 } | 87 } |
| 68 | 88 |
| 69 String ExceptionMessages::argumentNullOrIncorrectType(int argumentIndex, const S
tring& expectedType) | 89 String ExceptionMessages::argumentNullOrIncorrectType(int argumentIndex, const S
tring& expectedType) |
| 70 { | 90 { |
| 71 return "The " + ordinalNumber(argumentIndex) + " argument provided is either
null, or an invalid " + expectedType + " object."; | 91 return "The " + ordinalNumber(argumentIndex) + " argument provided is either
null, or an invalid " + expectedType + " object."; |
| 72 } | 92 } |
| 73 | 93 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 return formatPotentiallyNonFiniteNumber(number); | 155 return formatPotentiallyNonFiniteNumber(number); |
| 136 } | 156 } |
| 137 | 157 |
| 138 template <> | 158 template <> |
| 139 String ExceptionMessages::formatNumber<double>(double number) | 159 String ExceptionMessages::formatNumber<double>(double number) |
| 140 { | 160 { |
| 141 return formatPotentiallyNonFiniteNumber(number); | 161 return formatPotentiallyNonFiniteNumber(number); |
| 142 } | 162 } |
| 143 | 163 |
| 144 } // namespace WebCore | 164 } // namespace WebCore |
| OLD | NEW |