Chromium Code Reviews| Index: content/browser/resources/media/new/util.js |
| diff --git a/content/browser/resources/media/new/util.js b/content/browser/resources/media/new/util.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e6c487a1b70556dd3f990ef96dcc609aaf9e250b |
| --- /dev/null |
| +++ b/content/browser/resources/media/new/util.js |
| @@ -0,0 +1,22 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| + |
|
scherkus (not reviewing)
2013/07/29 23:09:23
remove extra blank line
Ty Overby
2013/07/29 23:26:56
Done.
|
| +/** |
| + * @fileoverview Some utility functions that don't belong anywhere else in the |
| + * code. |
| + */ |
| + |
| +var util = {}; |
| +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
|
| +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.
|
| + 'use strict'; |
| + var key; |
| + for (key in obj) { |
| + if (obj.hasOwnProperty(key)) { |
| + f.call(optObj, obj[key], key, obj); |
| + } |
| + } |
| +}; |
| + |
|
scherkus (not reviewing)
2013/07/29 23:09:23
remove extra blank line
Ty Overby
2013/07/29 23:26:56
Done.
|