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

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

Issue 12440030: Use utils.forEach everywhere rather than Array.prototype.forEach to guard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make foreach of an array give numbers 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/resources/extensions/storage_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/storage_custom_bindings.js b/chrome/renderer/resources/extensions/storage_custom_bindings.js
index 869a555804c7e45d08066c2876d9fb3d976f5601..5d40e1d9bfba203fbd4551e13eabc97752693e8f 100644
--- a/chrome/renderer/resources/extensions/storage_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/storage_custom_bindings.js
@@ -6,6 +6,7 @@
var binding = require('binding').Binding.create('storage');
+var forEach = require('utils').forEach;
var normalizeArgumentsAndValidate =
require('schemaUtils').normalizeArgumentsAndValidate
var sendRequest = require('sendRequest').sendRequest;
@@ -26,7 +27,7 @@ binding.registerCustomType('storage.StorageArea', function() {
// even generate) for other APIs that need to do this. Same for other
// callers of registerCustomType().
var self = this;
- function bindApiFunction(functionName) {
+ function bindApiFunction(i, functionName) {
self[functionName] = function() {
var funSchema = this.functionSchemas[functionName];
var args = Array.prototype.slice.call(arguments);
@@ -39,7 +40,7 @@ binding.registerCustomType('storage.StorageArea', function() {
};
}
var apiFunctions = ['get', 'set', 'remove', 'clear', 'getBytesInUse'];
- apiFunctions.forEach(bindApiFunction);
+ forEach(apiFunctions, bindApiFunction);
}
return StorageArea;

Powered by Google App Engine
This is Rietveld 408576698