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

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

Issue 17451011: Make the externally connectable browser test clobber all of the builtins, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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/extensions/json_schema.js
diff --git a/chrome/renderer/resources/extensions/json_schema.js b/chrome/renderer/resources/extensions/json_schema.js
index 19d36340ed3397610e765f200852c5bd033a41cb..c894ef28d8ed5596452639d46b88ce90f1513f7a 100644
--- a/chrome/renderer/resources/extensions/json_schema.js
+++ b/chrome/renderer/resources/extensions/json_schema.js
@@ -167,18 +167,18 @@ JSONSchemaValidator.prototype.addTypes = function(typeOrTypeList) {
JSONSchemaValidator.prototype.getAllTypesForSchema = function(schema) {
var schemaTypes = [];
if (schema.type)
- schemaTypes.push(schema.type);
+ $Array.push(schemaTypes, schema.type);
if (schema.choices) {
for (var i = 0; i < schema.choices.length; i++) {
var choiceTypes = this.getAllTypesForSchema(schema.choices[i]);
- schemaTypes = schemaTypes.concat(choiceTypes);
+ schemaTypes = $Array.concat(schemaTypes, choiceTypes);
}
}
var ref = schema['$ref'];
if (ref) {
var type = this.getOrAddType(ref);
CHECK(type, 'Could not find type ' + ref);
- schemaTypes = schemaTypes.concat(this.getAllTypesForSchema(type));
+ schemaTypes = $Array.concat(schemaTypes, this.getAllTypesForSchema(type));
}
return schemaTypes;
};
@@ -341,7 +341,7 @@ JSONSchemaValidator.prototype.validateObject =
// TODO(aa): If it ever turns out that we actually want this to work,
// there are other checks we could put here, like requiring that schema
// properties be objects that have a 'type' property.
- if (!schema.properties.hasOwnProperty(prop))
+ if (!$Object.hasOwnProperty(schema.properties, prop))
continue;
var propPath = path ? path + "." + prop : prop;
@@ -377,7 +377,7 @@ JSONSchemaValidator.prototype.validateObject =
continue;
// Any properties inherited through the prototype are ignored.
- if (!instance.hasOwnProperty(prop))
+ if (!$Object.hasOwnProperty(instance, prop))
continue;
var propPath = path ? path + "." + prop : prop;
@@ -502,7 +502,7 @@ JSONSchemaValidator.prototype.validateType = function(instance, schema, path) {
* message.
*/
JSONSchemaValidator.prototype.addError = function(path, key, replacements) {
- this.errors.push({
+ $Array.push(this.errors, {
path: path,
message: JSONSchemaValidator.formatError(key, replacements)
});
« no previous file with comments | « chrome/renderer/resources/extensions/image_util.js ('k') | chrome/renderer/resources/extensions/last_error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698