Skip to content

Commit

Permalink
Object.keys fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 11, 2012
1 parent b024271 commit c680365
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions browser.js
Expand Up @@ -2,10 +2,16 @@ var path = require('path');
var parse = require('./browser/parse');
var withPrefix = require('./browser/with_prefix');

var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) keys.push(key);
return keys;
};

module.exports = function (prefix, files) {
var cssFiles = [];
var elems = {};
Object.keys(files).forEach(function (file) {
objectKeys(files).forEach(function (file) {
if (/\.css$/i.test(file)) {
cssFiles.push(files[file]);
}
Expand Down Expand Up @@ -38,7 +44,7 @@ module.exports = function (prefix, files) {
return parse(prefix, src);
};

y.files = Object.keys(files);
y.files = objectKeys(files);

return y;
};

0 comments on commit c680365

Please sign in to comment.