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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 var s = typeof value; | 128 var s = typeof value; |
129 | 129 |
130 if (s == "object") { | 130 if (s == "object") { |
131 if (value === null) { | 131 if (value === null) { |
132 return "null"; | 132 return "null"; |
133 } else if (Object.prototype.toString.call(value) == "[object Array]") { | 133 } else if (Object.prototype.toString.call(value) == "[object Array]") { |
134 return "array"; | 134 return "array"; |
135 } else if (typeof(ArrayBuffer) != "undefined" && | 135 } else if (typeof(ArrayBuffer) != "undefined" && |
136 value.constructor == ArrayBuffer) { | 136 value.constructor == ArrayBuffer) { |
137 return "binary"; | 137 return "binary"; |
138 } else if (typeof(Uint8Array) != "undefined" && | |
139 value.constructor == Uint8Array) { | |
140 return "binary"; | |
not at google - send to devlin
2014/06/03 17:53:33
+asargent here who I think implemented binary? 2 i
asargent_no_longer_on_chrome
2014/06/03 20:52:50
I was neither author nor reviewer - looks like thi
| |
138 } | 141 } |
139 } else if (s == "number") { | 142 } else if (s == "number") { |
140 if (value % 1 == 0) { | 143 if (value % 1 == 0) { |
141 return "integer"; | 144 return "integer"; |
142 } | 145 } |
143 } | 146 } |
144 | 147 |
145 return s; | 148 return s; |
146 }; | 149 }; |
147 | 150 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 }; | 519 }; |
517 | 520 |
518 /** | 521 /** |
519 * Resets errors to an empty list so you can call 'validate' again. | 522 * Resets errors to an empty list so you can call 'validate' again. |
520 */ | 523 */ |
521 JSONSchemaValidator.prototype.resetErrors = function() { | 524 JSONSchemaValidator.prototype.resetErrors = function() { |
522 this.errors = []; | 525 this.errors = []; |
523 }; | 526 }; |
524 | 527 |
525 exports.JSONSchemaValidator = JSONSchemaValidator; | 528 exports.JSONSchemaValidator = JSONSchemaValidator; |
OLD | NEW |