| 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 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 "config.h" | 31 #include "config.h" |
| 32 #include "bindings/v8/ExceptionMessages.h" | 32 #include "bindings/v8/ExceptionMessages.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 String ExceptionMessages::failedToConstruct(const String& type, const String& de
tail) |
| 37 { |
| 38 return "Failed to construct '" + type + (!detail.isEmpty() ? String("': " +
detail) : String("'")); |
| 39 } |
| 40 |
| 36 String ExceptionMessages::failedToExecute(const String& method, const String& ty
pe, const String& detail) | 41 String ExceptionMessages::failedToExecute(const String& method, const String& ty
pe, const String& detail) |
| 37 { | 42 { |
| 38 return "Failed to execute '" + method + "' on '" + type + (!detail.isEmpty()
? String("': " + detail) : String("'")); | 43 return "Failed to execute '" + method + "' on '" + type + (!detail.isEmpty()
? String("': " + detail) : String("'")); |
| 39 } | 44 } |
| 40 | 45 |
| 41 String ExceptionMessages::failedToGet(const String& property, const String& type
, const String& detail) | 46 String ExceptionMessages::failedToGet(const String& property, const String& type
, const String& detail) |
| 42 { | 47 { |
| 43 return "Failed to read the '" + property + "' property from '" + type + "':
" + detail; | 48 return "Failed to read the '" + property + "' property from '" + type + "':
" + detail; |
| 44 } | 49 } |
| 45 | 50 |
| 46 String ExceptionMessages::failedToSet(const String& property, const String& type
, const String& detail) | 51 String ExceptionMessages::failedToSet(const String& property, const String& type
, const String& detail) |
| 47 { | 52 { |
| 48 return "Failed to set the '" + property + "' property on '" + type + "': " +
detail; | 53 return "Failed to set the '" + property + "' property on '" + type + "': " +
detail; |
| 49 } | 54 } |
| 50 | 55 |
| 56 String ExceptionMessages::notEnoughArguments(unsigned expected, unsigned provide
d) |
| 57 { |
| 58 return String::number(expected) + " argument" + (expected > 1 ? "s" : "") +
" required, but only " + String::number(provided) + " present."; |
| 59 } |
| 60 |
| 51 } // namespace WebCore | 61 } // namespace WebCore |
| OLD | NEW |