Updated to v1.9.9

This commit is contained in:
Henry Whitaker
2020-11-07 15:27:50 +00:00
parent 15d3583423
commit 8d811862a0
6349 changed files with 338454 additions and 213438 deletions

View File

@@ -2,6 +2,7 @@
var hasSymbols = require('has-symbols/shams')();
var forEach = require('for-each');
var has = require('has');
module.exports = function (assign, t) {
t.test('error cases', function (st) {
@@ -34,7 +35,7 @@ module.exports = function (assign, t) {
st.test('boolean', function (st2) {
var bool = assign(true, { a: signal });
st2.equal(typeof bool, 'object', 'bool is object');
st.equal(Boolean.prototype.valueOf.call(bool), true, 'bool coerces to `true`');
st2.equal(Boolean.prototype.valueOf.call(bool), true, 'bool coerces to `true`');
st2.equal(bool.a, signal, 'source properties copied');
st2.end();
});
@@ -103,6 +104,18 @@ module.exports = function (assign, t) {
st.end();
});
/* globals window */
t.test('works with window.location', { skip: typeof window === 'undefined' }, function (st) {
var target = {};
assign(target, window.location);
for (var prop in window.location) {
if (has(window.location, prop)) {
st.deepEqual(target[prop], window.location[prop], prop + ' is copied');
}
}
st.end();
});
t.test('merge N objects', function (st) {
var target = { a: 1 };
var source1 = { b: 2 };
@@ -146,7 +159,7 @@ module.exports = function (assign, t) {
st.end();
});
t.test('does not fail when symbols are not present', function (st) {
t.test('does not fail when symbols are not present', { skip: !Object.isFrozen || Object.isFrozen(Object) }, function (st) {
var getSyms;
if (hasSymbols) {
getSyms = Object.getOwnPropertySymbols;