Chromium Code Reviews| Index: Source/bindings/v8/ExceptionMessages.cpp |
| diff --git a/Source/bindings/v8/ExceptionMessages.cpp b/Source/bindings/v8/ExceptionMessages.cpp |
| index e1d879fe97f450f8c8da47fa431fbe2bdd4aeb59..7aa070598098d4a92bea87e887d04c4feaceb522 100644 |
| --- a/Source/bindings/v8/ExceptionMessages.cpp |
| +++ b/Source/bindings/v8/ExceptionMessages.cpp |
| @@ -58,9 +58,34 @@ String ExceptionMessages::failedToDelete(const String& property, const String& t |
| return "Failed to delete the '" + property + "' property from '" + type + "': " + detail; |
| } |
| -String ExceptionMessages::notASequenceType(const String& argument) |
| +String ExceptionMessages::notASequenceTypeArgumentOrValue(int argumentIndexOrValue) |
| { |
| - return argument + " argument is neither an array, nor does it have indexed properties."; |
| + String kind(" argument"); |
| + |
| + String prefix; |
| + switch (argumentIndexOrValue) { |
| + case 1: |
| + prefix = "First"; |
| + break; |
| + case 2: |
| + prefix = "Second"; |
| + break; |
| + case 3: |
| + prefix = "Third"; |
| + break; |
| + default: |
| + if (argumentIndexOrValue <= 0) |
| + 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
|
| + else |
| + prefix = String::number(argumentIndexOrValue) + "th"; |
| + break; |
| + } |
| + return prefix + kind + " is neither an array, nor does it have indexed properties."; |
| +} |
| + |
| +String ExceptionMessages::notASequenceTypeProperty(const String& propertyName) |
| +{ |
| + return "'" + propertyName + "' property is neither an array, nor does it have indexed properties."; |
| } |
| String ExceptionMessages::notEnoughArguments(unsigned expected, unsigned provided) |