~webapps/unity-js-scopes/node.js

« back to all changes in this revision

Viewing changes to tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/filter.js

  • Committer: Marcus Tomlinson
  • Date: 2015-11-13 07:59:04 UTC
  • Revision ID: marcus.tomlinson@canonical.com-20151113075904-h0swczmoq1rvstfc
Node v4 (stable)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'use strict';
 
2
 
 
3
var callable = require('./valid-callable')
 
4
  , forEach  = require('./for-each')
 
5
 
 
6
  , call = Function.prototype.call;
 
7
 
 
8
module.exports = function (obj, cb/*, thisArg*/) {
 
9
        var o = {}, thisArg = arguments[2];
 
10
        callable(cb);
 
11
        forEach(obj, function (value, key, obj, index) {
 
12
                if (call.call(cb, thisArg, value, key, obj, index)) o[key] = obj[key];
 
13
        });
 
14
        return o;
 
15
};