Skip to content

Remove polyfills for ES5 features #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = function (obj, opts) {
if (typeof node !== 'object' || node === null) {
return JSON.stringify(node);
}
if (isArray(node)) {
if (Array.isArray(node)) {
var out = [];
for (var i = 0; i < node.length; i++) {
var item = stringify(node, i, node[i], level+1) || JSON.stringify(null);
Expand All @@ -48,7 +48,7 @@ module.exports = function (obj, opts) {
}
else seen.push(node);

var keys = objectKeys(node).sort(cmp && cmp(node));
var keys = Object.keys(node).sort(cmp && cmp(node));
var out = [];
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
Expand All @@ -67,16 +67,3 @@ module.exports = function (obj, opts) {
}
})({ '': obj }, '', obj, 0);
};

var isArray = Array.isArray || function (x) {
return {}.toString.call(x) === '[object Array]';
};

var objectKeys = Object.keys || function (obj) {
var has = Object.prototype.hasOwnProperty || function () { return true };
var keys = [];
for (var key in obj) {
if (has.call(obj, key)) keys.push(key);
}
return keys;
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"testling": {
"files": "test/*.js",
"browsers": [
"ie/8..latest",
"ie/9..latest",
"ff/5", "ff/latest",
"chrome/15", "chrome/latest",
"safari/latest",
Expand Down