Skip to content

Commit 14ff3fa

Browse files
committed
chore(power-assert-formatter): rebuild web bundle
1 parent 9285c34 commit 14ff3fa

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

build/power-assert-formatter.js

+32-29
Original file line numberDiff line numberDiff line change
@@ -8540,44 +8540,47 @@ this['DIFF_EQUAL'] = DIFF_EQUAL;
85408540
"use strict";
85418541

85428542
// modified from https://github.com/es-shims/es5-shim
8543-
var has = Object.prototype.hasOwnProperty,
8544-
toString = Object.prototype.toString,
8545-
isArgs = _dereq_('./isArguments'),
8546-
hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'),
8547-
hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
8548-
dontEnums = [
8549-
"toString",
8550-
"toLocaleString",
8551-
"valueOf",
8552-
"hasOwnProperty",
8553-
"isPrototypeOf",
8554-
"propertyIsEnumerable",
8555-
"constructor"
8556-
];
8543+
var has = Object.prototype.hasOwnProperty;
8544+
var toString = Object.prototype.toString;
8545+
var isArgs = _dereq_('./isArguments');
8546+
var hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString');
8547+
var hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype');
8548+
var dontEnums = [
8549+
"toString",
8550+
"toLocaleString",
8551+
"valueOf",
8552+
"hasOwnProperty",
8553+
"isPrototypeOf",
8554+
"propertyIsEnumerable",
8555+
"constructor"
8556+
];
85578557

85588558
var keysShim = function keys(object) {
8559-
var isObject = object !== null && typeof object === 'object',
8560-
isFunction = toString.call(object) === '[object Function]',
8561-
isArguments = isArgs(object),
8562-
theKeys = [];
8559+
var isObject = object !== null && typeof object === 'object';
8560+
var isFunction = toString.call(object) === '[object Function]';
8561+
var isArguments = isArgs(object);
8562+
var isString = isObject && toString.call(object) === '[object String]';
8563+
var theKeys = [];
85638564

85648565
if (!isObject && !isFunction && !isArguments) {
85658566
throw new TypeError("Object.keys called on a non-object");
85668567
}
85678568

8568-
if (isArguments) {
8569-
for (var key in object) {
8570-
if (has.call(object, key)) {
8571-
theKeys.push(Number(key));
8572-
}
8569+
var skipProto = hasProtoEnumBug && isFunction;
8570+
if (isString && object.length > 0 && !has.call(object, 0)) {
8571+
for (var i = 0; i < object.length; ++i) {
8572+
theKeys.push(String(i));
85738573
}
8574-
} else {
8575-
var name,
8576-
skipProto = hasProtoEnumBug && isFunction;
8574+
}
85778575

8578-
for (name in object) {
8576+
if (isArguments && object.length > 0) {
8577+
for (var j = 0; j < object.length; ++j) {
8578+
theKeys.push(String(j));
8579+
}
8580+
} else {
8581+
for (var name in object) {
85798582
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
8580-
theKeys.push(name);
8583+
theKeys.push(String(name));
85818584
}
85828585
}
85838586
}
@@ -8588,7 +8591,7 @@ var keysShim = function keys(object) {
85888591

85898592
for (var j = 0; j < dontEnums.length; ++j) {
85908593
if (!(skipConstructor && dontEnums[j] === 'constructor') && has.call(object, dontEnums[j])) {
8591-
theKeys.push(dontEnum);
8594+
theKeys.push(dontEnums[j]);
85928595
}
85938596
}
85948597
}

0 commit comments

Comments
 (0)