| 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 // Routines used to validate and normalize arguments. | 5 // Routines used to validate and normalize arguments. |
| 6 | 6 |
| 7 require('json_schema'); // for chromeHidden.JSONSchemaValidator |
| 7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); | 8 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); |
| 8 var chrome = requireNative('chrome').GetChrome(); | 9 var chrome = requireNative('chrome').GetChrome(); |
| 9 | 10 |
| 10 // TODO(benwells): unit test this file. | 11 // TODO(benwells): unit test this file. |
| 11 // JSONSchemaValidator is not loaded in unit tests. | 12 // JSONSchemaValidator is not loaded in unit tests. |
| 12 var validate; | 13 var validate; |
| 13 if (chromeHidden.JSONSchemaValidator) { | 14 if (chromeHidden.JSONSchemaValidator) { |
| 14 var schemaValidator = new chromeHidden.JSONSchemaValidator(); | 15 var schemaValidator = new chromeHidden.JSONSchemaValidator(); |
| 15 | 16 |
| 16 // Validate arguments. | 17 // Validate arguments. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return true; | 155 return true; |
| 155 } | 156 } |
| 156 } | 157 } |
| 157 return false; | 158 return false; |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 exports.isFunctionSignatureAmbiguous = isFunctionSignatureAmbiguous; | 161 exports.isFunctionSignatureAmbiguous = isFunctionSignatureAmbiguous; |
| 161 exports.normalizeArgumentsAndValidate = normalizeArgumentsAndValidate; | 162 exports.normalizeArgumentsAndValidate = normalizeArgumentsAndValidate; |
| 162 exports.schemaValidator = schemaValidator; | 163 exports.schemaValidator = schemaValidator; |
| 163 exports.validate = validate; | 164 exports.validate = validate; |
| OLD | NEW |