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

Unified Diff: trunk/src/chrome/renderer/resources/extensions/json_schema.js

Issue 47403003: Revert 231982 "Docserver: Display enum value descriptions in API..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/renderer/resources/extensions/json_schema.js
===================================================================
--- trunk/src/chrome/renderer/resources/extensions/json_schema.js (revision 232015)
+++ trunk/src/chrome/renderer/resources/extensions/json_schema.js (working copy)
@@ -53,10 +53,6 @@
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.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;
};

Powered by Google App Engine
This is Rietveld 408576698