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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 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) |
52 { | 52 { |
53 return "Failed to set the '" + property + "' property on '" + type + "': " + detail; | 53 return "Failed to set the '" + property + "' property on '" + type + "': " + detail; |
54 } | 54 } |
55 | 55 |
56 String ExceptionMessages::failedToDelete(const String& property, const String& t ype, const String& detail) | 56 String ExceptionMessages::failedToDelete(const String& property, const String& t ype, const String& detail) |
57 { | 57 { |
58 return "Failed to delete the '" + property + "' property from '" + type + "' : " + detail; | 58 return "Failed to delete the '" + property + "' property from '" + type + "' : " + detail; |
59 } | 59 } |
60 | 60 |
61 String ExceptionMessages::notASequenceType(const String& argument) | 61 String ExceptionMessages::notASequenceTypeArgumentOrValue(int argumentIndexOrVal ue) |
62 { | 62 { |
63 return argument + " argument is neither an array, nor does it have indexed p roperties."; | 63 String kind(" argument"); |
64 | |
65 String prefix; | |
66 switch (argumentIndexOrValue) { | |
67 case 1: | |
68 prefix = "First"; | |
69 break; | |
70 case 2: | |
71 prefix = "Second"; | |
72 break; | |
73 case 3: | |
74 prefix = "Third"; | |
75 break; | |
76 default: | |
77 if (argumentIndexOrValue <= 0) | |
78 kind = "Value"; | |
Mike West
2013/10/25 07:15:13
How about "the value provided"?
sof
2013/10/25 07:18:37
Good idea, will do (but won't be able to until thi
| |
79 else | |
80 prefix = String::number(argumentIndexOrValue) + "th"; | |
81 break; | |
82 } | |
83 return prefix + kind + " is neither an array, nor does it have indexed prope rties."; | |
84 } | |
85 | |
86 String ExceptionMessages::notASequenceTypeProperty(const String& propertyName) | |
87 { | |
88 return "'" + propertyName + "' property is neither an array, nor does it hav e indexed properties."; | |
64 } | 89 } |
65 | 90 |
66 String ExceptionMessages::notEnoughArguments(unsigned expected, unsigned provide d) | 91 String ExceptionMessages::notEnoughArguments(unsigned expected, unsigned provide d) |
67 { | 92 { |
68 return String::number(expected) + " argument" + (expected > 1 ? "s" : "") + " required, but only " + String::number(provided) + " present."; | 93 return String::number(expected) + " argument" + (expected > 1 ? "s" : "") + " required, but only " + String::number(provided) + " present."; |
69 } | 94 } |
70 | 95 |
71 } // namespace WebCore | 96 } // namespace WebCore |
OLD | NEW |