Skip to content

Commit

Permalink
remove Object.keys fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed May 29, 2017
1 parent 58e7268 commit 564e738
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions tests/all.js
Expand Up @@ -3,22 +3,8 @@
/* jshint -W097 */

'use strict';

var keys;
var tree;

if (Object.keys) {
keys = Object.keys;
} else {
keys = function(obj) {
var result = [];
for (var key in obj) {
result.push(key);
}
return result;
};
}

/**
* Simple helper to get the current state of a given module.
*/
Expand Down Expand Up @@ -116,7 +102,7 @@ test('simple define/require', function() {
var foo = require('foo');
equal(foo, undefined);
equal(fooCalled, 1);
deepEqual(keys(requirejs.entries), ['foo']);
deepEqual(Object.keys(requirejs.entries), ['foo']);

stats = statsForMonitor('loaderjs', tree);

Expand Down Expand Up @@ -152,7 +138,7 @@ test('simple define/require', function() {
pendingQueueLength: 1
});

deepEqual(keys(requirejs.entries), ['foo']);
deepEqual(Object.keys(requirejs.entries), ['foo']);
});


Expand Down Expand Up @@ -181,7 +167,7 @@ test('define without deps', function() {

equal(foo, undefined);
equal(fooCalled, 1);
deepEqual(keys(requirejs.entries), ['foo']);
deepEqual(Object.keys(requirejs.entries), ['foo']);
});


Expand All @@ -190,7 +176,7 @@ test('multiple define/require', function() {

});

deepEqual(keys(requirejs.entries), ['foo']);
deepEqual(Object.keys(requirejs.entries), ['foo']);

var stats = statsForMonitor('loaderjs', tree);

Expand Down Expand Up @@ -226,7 +212,7 @@ test('multiple define/require', function() {
pendingQueueLength: 0
});

deepEqual(keys(requirejs.entries), ['foo', 'bar']);
deepEqual(Object.keys(requirejs.entries), ['foo', 'bar']);
});


Expand Down

0 comments on commit 564e738

Please sign in to comment.