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

Side by Side Diff: chrome/renderer/resources/extensions/schema_utils.js

Issue 12313142: Revert 184837 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
8 var chrome = requireNative('chrome').GetChrome();
9 8
10 // TODO(benwells): unit test this file. 9 // TODO(benwells): unit test this file.
11 // JSONSchemaValidator is not loaded in unit tests. 10 // JSONSchemaValidator is not loaded in unit tests.
12 var validate; 11 var validate;
13 if (chromeHidden.JSONSchemaValidator) { 12 if (chromeHidden.JSONSchemaValidator) {
14 var schemaValidator = new chromeHidden.JSONSchemaValidator(); 13 var schemaValidator = new chromeHidden.JSONSchemaValidator();
15 14
16 // Validate arguments. 15 // Validate arguments.
17 validate = function(args, parameterSchemas) { 16 validate = function(args, parameterSchemas) {
18 if (args.length > parameterSchemas.length) 17 if (args.length > parameterSchemas.length)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 return true; 153 return true;
155 } 154 }
156 } 155 }
157 return false; 156 return false;
158 }; 157 };
159 158
160 exports.isFunctionSignatureAmbiguous = isFunctionSignatureAmbiguous; 159 exports.isFunctionSignatureAmbiguous = isFunctionSignatureAmbiguous;
161 exports.normalizeArgumentsAndValidate = normalizeArgumentsAndValidate; 160 exports.normalizeArgumentsAndValidate = normalizeArgumentsAndValidate;
162 exports.schemaValidator = schemaValidator; 161 exports.schemaValidator = schemaValidator;
163 exports.validate = validate; 162 exports.validate = validate;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698