source: imaps-frontend/node_modules/object-keys/index.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 823 bytes
RevLine 
[d565449]1'use strict';
2
3var slice = Array.prototype.slice;
4var isArgs = require('./isArguments');
5
6var origKeys = Object.keys;
7var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
8
9var originalKeys = Object.keys;
10
11keysShim.shim = function shimObjectKeys() {
12 if (Object.keys) {
13 var keysWorksWithArguments = (function () {
14 // Safari 5.0 bug
15 var args = Object.keys(arguments);
16 return args && args.length === arguments.length;
17 }(1, 2));
18 if (!keysWorksWithArguments) {
19 Object.keys = function keys(object) { // eslint-disable-line func-name-matching
20 if (isArgs(object)) {
21 return originalKeys(slice.call(object));
22 }
23 return originalKeys(object);
24 };
25 }
26 } else {
27 Object.keys = keysShim;
28 }
29 return Object.keys || keysShim;
30};
31
32module.exports = keysShim;
Note: See TracBrowser for help on using the repository browser.