Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 | |
|
scherkus (not reviewing)
2013/07/29 23:09:23
remove extra blank line
Ty Overby
2013/07/29 23:26:56
Done.
| |
| 6 /** | |
| 7 * @fileoverview Some utility functions that don't belong anywhere else in the | |
| 8 * code. | |
| 9 */ | |
| 10 | |
| 11 var util = {}; | |
| 12 util.object = {}; | |
|
scherkus (not reviewing)
2013/07/29 23:09:23
nit: I'd drop the .object sub-module namespace
Ty Overby
2013/07/29 23:26:56
I disagree. Usually forEach is defined on arrays/
scherkus (not reviewing)
2013/07/29 23:55:18
SGTM
| |
| 13 util.object.forEach = function(obj, f, optObj) { | |
|
scherkus (not reviewing)
2013/07/29 23:09:23
docs on functions
Ty Overby
2013/07/29 23:26:56
Done.
| |
| 14 'use strict'; | |
| 15 var key; | |
| 16 for (key in obj) { | |
| 17 if (obj.hasOwnProperty(key)) { | |
| 18 f.call(optObj, obj[key], key, obj); | |
| 19 } | |
| 20 } | |
| 21 }; | |
| 22 | |
|
scherkus (not reviewing)
2013/07/29 23:09:23
remove extra blank line
Ty Overby
2013/07/29 23:26:56
Done.
| |
| OLD | NEW |