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

Unified Diff: chrome/renderer/resources/json_schema.js

Issue 6413014: Original patch from issue 570048 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: a few fixes Created 9 years, 10 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: chrome/renderer/resources/json_schema.js
diff --git a/chrome/renderer/resources/json_schema.js b/chrome/renderer/resources/json_schema.js
index ff1c0a067a35222bbd61769ba86ba5df0571b91b..f5d632a41a02a38f9bbb044303ee99d51a194287 100644
--- a/chrome/renderer/resources/json_schema.js
+++ b/chrome/renderer/resources/json_schema.js
@@ -405,14 +405,16 @@ chromeHidden.JSONSchemaValidator.prototype.validateNumber = function(
instance == Number.NEGATIVE_INFINITY )
this.addError(path, "numberFiniteNotNan", [instance]);
- if (schema.minimum && instance < schema.minimum)
+ if (typeof schema.minimum != 'undefined' && instance < schema.minimum)
this.addError(path, "numberMinValue", [schema.minimum]);
- if (schema.maximum && instance > schema.maximum)
+ if (typeof schema.maximum != 'undefined' && instance > schema.maximum)
this.addError(path, "numberMaxValue", [schema.maximum]);
- if (schema.maxDecimal && instance * Math.pow(10, schema.maxDecimal) % 1)
+ if (typeof schema.maxDecimal != 'undefined' &&
+ instance * Math.pow(10, schema.maxDecimal) % 1) {
this.addError(path, "numberMaxDecimal", [schema.maxDecimal]);
+ }
};
/**

Powered by Google App Engine
This is Rietveld 408576698