summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/resources
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 06:38:29 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 06:38:29 +0000
commite685143bd7d15b048b7ca9cb4ec0240827842266 (patch)
tree74f100269c45c656a554a794d4e63749b91fe026 /chrome/renderer/resources
parent7a29680b81b983ac1da1b5fdbe3ad096bad7015a (diff)
downloadchromium_src-e685143bd7d15b048b7ca9cb4ec0240827842266.zip
chromium_src-e685143bd7d15b048b7ca9cb4ec0240827842266.tar.gz
chromium_src-e685143bd7d15b048b7ca9cb4ec0240827842266.tar.bz2
Revert 231982 "Docserver: Display enum value descriptions in API..."
"JsonSchemaTest.TestEnum" started failing on Windows bot after this change. > Docserver: Display enum value descriptions in API docs. > > This modifies the json schema to allow both primitive types and > dictionaries with properties "name" and optional "description" for enum > values. > > BUG=310454 > > Review URL: https://codereview.chromium.org/39113003 TBR=sammc@chromium.org Review URL: https://codereview.chromium.org/47403003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232016 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/resources')
-rw-r--r--chrome/renderer/resources/extensions/json_schema.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/chrome/renderer/resources/extensions/json_schema.js b/chrome/renderer/resources/extensions/json_schema.js
index 3c6f394..4b8996a 100644
--- a/chrome/renderer/resources/extensions/json_schema.js
+++ b/chrome/renderer/resources/extensions/json_schema.js
@@ -53,10 +53,6 @@ function isOptionalValue(value) {
return typeof(value) === 'undefined' || value === null;
}
-function enumToString(enumValue) {
- return enumValue.name || enumValue;
-}
-
/**
* Validates an instance against a schema and accumulates errors. Usage:
*
@@ -321,12 +317,11 @@ JSONSchemaValidator.prototype.validateChoices =
*/
JSONSchemaValidator.prototype.validateEnum = function(instance, schema, path) {
for (var i = 0; i < schema.enum.length; i++) {
- if (instance === enumToString(schema.enum[i]))
+ if (instance === schema.enum[i])
return true;
}
- this.addError(path, "invalidEnum",
- [schema.enum.map(enumToString).join(", ")]);
+ this.addError(path, "invalidEnum", [schema.enum.join(", ")]);
return false;
};