Skip to content

Commit 0d82916

Browse files
committed
[Fix] utils.merge: avoid a crash with a null target and an array source
1 parent c103b90 commit 0d82916

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ var utils = require('../lib/utils');
66
test('merge()', function (t) {
77
t.deepEqual(utils.merge(null, true), [null, true], 'merges true into null');
88

9+
t.deepEqual(utils.merge(null, [42]), [null, 42], 'merges null into an array');
10+
911
t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
1012

1113
var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });

0 commit comments

Comments
 (0)