| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 String ExceptionMessages::ArgumentNullOrIncorrectType( | 117 String ExceptionMessages::ArgumentNullOrIncorrectType( |
| 118 int argument_index, | 118 int argument_index, |
| 119 const String& expected_type) { | 119 const String& expected_type) { |
| 120 return "The " + OrdinalNumber(argument_index) + | 120 return "The " + OrdinalNumber(argument_index) + |
| 121 " argument provided is either null, or an invalid " + expected_type + | 121 " argument provided is either null, or an invalid " + expected_type + |
| 122 " object."; | 122 " object."; |
| 123 } | 123 } |
| 124 | 124 |
| 125 String ExceptionMessages::NotAnArrayTypeArgumentOrValue(int argument_index) { | |
| 126 String kind; | |
| 127 if (argument_index) // method argument | |
| 128 kind = OrdinalNumber(argument_index) + " argument"; | |
| 129 else // value, e.g. attribute setter | |
| 130 kind = "value provided"; | |
| 131 return "The " + kind + | |
| 132 " is neither an array, nor does it have indexed properties."; | |
| 133 } | |
| 134 | |
| 135 String ExceptionMessages::NotASequenceTypeProperty( | 125 String ExceptionMessages::NotASequenceTypeProperty( |
| 136 const String& property_name) { | 126 const String& property_name) { |
| 137 return "'" + property_name + | 127 return "'" + property_name + |
| 138 "' property is neither an array, nor does it have indexed properties."; | 128 "' property is neither an array, nor does it have indexed properties."; |
| 139 } | 129 } |
| 140 | 130 |
| 141 String ExceptionMessages::NotEnoughArguments(unsigned expected, | 131 String ExceptionMessages::NotEnoughArguments(unsigned expected, |
| 142 unsigned provided) { | 132 unsigned provided) { |
| 143 return String::Number(expected) + " argument" + (expected > 1 ? "s" : "") + | 133 return String::Number(expected) + " argument" + (expected > 1 ? "s" : "") + |
| 144 " required, but only " + String::Number(provided) + " present."; | 134 " required, but only " + String::Number(provided) + " present."; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 CORE_EXPORT String ExceptionMessages::FormatNumber<float>(float number) { | 177 CORE_EXPORT String ExceptionMessages::FormatNumber<float>(float number) { |
| 188 return FormatPotentiallyNonFiniteNumber(number); | 178 return FormatPotentiallyNonFiniteNumber(number); |
| 189 } | 179 } |
| 190 | 180 |
| 191 template <> | 181 template <> |
| 192 CORE_EXPORT String ExceptionMessages::FormatNumber<double>(double number) { | 182 CORE_EXPORT String ExceptionMessages::FormatNumber<double>(double number) { |
| 193 return FormatPotentiallyNonFiniteNumber(number); | 183 return FormatPotentiallyNonFiniteNumber(number); |
| 194 } | 184 } |
| 195 | 185 |
| 196 } // namespace blink | 186 } // namespace blink |
| OLD | NEW |