Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ExceptionMessages.cpp

Issue 2810843002: bindings: Make the sequence conversion code more complaint with WebIDL. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 String ExceptionMessages::ArgumentNullOrIncorrectType( 113 String ExceptionMessages::ArgumentNullOrIncorrectType(
114 int argument_index, 114 int argument_index,
115 const String& expected_type) { 115 const String& expected_type) {
116 return "The " + OrdinalNumber(argument_index) + 116 return "The " + OrdinalNumber(argument_index) +
117 " argument provided is either null, or an invalid " + expected_type + 117 " argument provided is either null, or an invalid " + expected_type +
118 " object."; 118 " object.";
119 } 119 }
120 120
121 String ExceptionMessages::NotAnArrayTypeArgumentOrValue(int argument_index) {
122 String kind;
123 if (argument_index) // method argument
124 kind = OrdinalNumber(argument_index) + " argument";
125 else // value, e.g. attribute setter
126 kind = "value provided";
127 return "The " + kind +
128 " is neither an array, nor does it have indexed properties.";
129 }
130
131 String ExceptionMessages::NotASequenceTypeProperty( 121 String ExceptionMessages::NotASequenceTypeProperty(
132 const String& property_name) { 122 const String& property_name) {
133 return "'" + property_name + 123 return "'" + property_name +
134 "' property is neither an array, nor does it have indexed properties."; 124 "' property is neither an array, nor does it have indexed properties.";
135 } 125 }
136 126
137 String ExceptionMessages::NotEnoughArguments(unsigned expected, 127 String ExceptionMessages::NotEnoughArguments(unsigned expected,
138 unsigned provided) { 128 unsigned provided) {
139 return String::Number(expected) + " argument" + (expected > 1 ? "s" : "") + 129 return String::Number(expected) + " argument" + (expected > 1 ? "s" : "") +
140 " required, but only " + String::Number(provided) + " present."; 130 " required, but only " + String::Number(provided) + " present.";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 CORE_EXPORT String ExceptionMessages::FormatNumber<float>(float number) { 173 CORE_EXPORT String ExceptionMessages::FormatNumber<float>(float number) {
184 return FormatPotentiallyNonFiniteNumber(number); 174 return FormatPotentiallyNonFiniteNumber(number);
185 } 175 }
186 176
187 template <> 177 template <>
188 CORE_EXPORT String ExceptionMessages::FormatNumber<double>(double number) { 178 CORE_EXPORT String ExceptionMessages::FormatNumber<double>(double number) {
189 return FormatPotentiallyNonFiniteNumber(number); 179 return FormatPotentiallyNonFiniteNumber(number);
190 } 180 }
191 181
192 } // namespace blink 182 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698