| 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "bindings/core/v8/ExceptionMessages.h" | 31 #include "bindings/core/v8/ExceptionMessages.h" |
| 32 | 32 |
| 33 #include "platform/Decimal.h" | 33 #include "platform/Decimal.h" |
| 34 #include "platform/wtf/MathExtras.h" | 34 #include "platform/wtf/MathExtras.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 String ExceptionMessages::FailedToConvertJSValue(const char* type) { |
| 39 return String::Format("Failed to convert value to '%s'.", type); |
| 40 } |
| 41 |
| 38 String ExceptionMessages::FailedToConstruct(const char* type, | 42 String ExceptionMessages::FailedToConstruct(const char* type, |
| 39 const String& detail) { | 43 const String& detail) { |
| 40 return "Failed to construct '" + String(type) + | 44 return "Failed to construct '" + String(type) + |
| 41 (!detail.IsEmpty() ? String("': " + detail) : String("'")); | 45 (!detail.IsEmpty() ? String("': " + detail) : String("'")); |
| 42 } | 46 } |
| 43 | 47 |
| 44 String ExceptionMessages::FailedToEnumerate(const char* type, | 48 String ExceptionMessages::FailedToEnumerate(const char* type, |
| 45 const String& detail) { | 49 const String& detail) { |
| 46 return "Failed to enumerate the properties of '" + String(type) + | 50 return "Failed to enumerate the properties of '" + String(type) + |
| 47 (!detail.IsEmpty() ? String("': " + detail) : String("'")); | 51 (!detail.IsEmpty() ? String("': " + detail) : String("'")); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 CORE_EXPORT String ExceptionMessages::FormatNumber<float>(float number) { | 187 CORE_EXPORT String ExceptionMessages::FormatNumber<float>(float number) { |
| 184 return FormatPotentiallyNonFiniteNumber(number); | 188 return FormatPotentiallyNonFiniteNumber(number); |
| 185 } | 189 } |
| 186 | 190 |
| 187 template <> | 191 template <> |
| 188 CORE_EXPORT String ExceptionMessages::FormatNumber<double>(double number) { | 192 CORE_EXPORT String ExceptionMessages::FormatNumber<double>(double number) { |
| 189 return FormatPotentiallyNonFiniteNumber(number); | 193 return FormatPotentiallyNonFiniteNumber(number); |
| 190 } | 194 } |
| 191 | 195 |
| 192 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |