| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // ----------------------------------------------------------------------------- | 5 // ----------------------------------------------------------------------------- |
| 6 // NOTE: If you change this file you need to touch renderer_resources.grd to | 6 // NOTE: If you change this file you need to touch renderer_resources.grd to |
| 7 // have your change take effect. | 7 // have your change take effect. |
| 8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 9 | 9 |
| 10 //============================================================================== | 10 //============================================================================== |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 * the input values. | 117 * the input values. |
| 118 */ | 118 */ |
| 119 chromeHidden.JSONSchemaValidator.getType = function(value) { | 119 chromeHidden.JSONSchemaValidator.getType = function(value) { |
| 120 var s = typeof value; | 120 var s = typeof value; |
| 121 | 121 |
| 122 if (s == "object") { | 122 if (s == "object") { |
| 123 if (value === null) { | 123 if (value === null) { |
| 124 return "null"; | 124 return "null"; |
| 125 } else if (Object.prototype.toString.call(value) == "[object Array]") { | 125 } else if (Object.prototype.toString.call(value) == "[object Array]") { |
| 126 return "array"; | 126 return "array"; |
| 127 } else if (value.constructor == ArrayBuffer) { |
| 128 return "binary"; |
| 127 } | 129 } |
| 128 } else if (s == "number") { | 130 } else if (s == "number") { |
| 129 if (value % 1 == 0) { | 131 if (value % 1 == 0) { |
| 130 return "integer"; | 132 return "integer"; |
| 131 } | 133 } |
| 132 } | 134 } |
| 133 | 135 |
| 134 return s; | 136 return s; |
| 135 }; | 137 }; |
| 136 | 138 |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 message: chromeHidden.JSONSchemaValidator.formatError(key, replacements) | 500 message: chromeHidden.JSONSchemaValidator.formatError(key, replacements) |
| 499 }); | 501 }); |
| 500 }; | 502 }; |
| 501 | 503 |
| 502 /** | 504 /** |
| 503 * Resets errors to an empty list so you can call 'validate' again. | 505 * Resets errors to an empty list so you can call 'validate' again. |
| 504 */ | 506 */ |
| 505 chromeHidden.JSONSchemaValidator.prototype.resetErrors = function() { | 507 chromeHidden.JSONSchemaValidator.prototype.resetErrors = function() { |
| 506 this.errors = []; | 508 this.errors = []; |
| 507 }; | 509 }; |
| OLD | NEW |