Skip to content

Commit dc0ffec

Browse files
committed
Conditionally use Object.assign shim
1 parent d3eabae commit dc0ffec

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

assert.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const AssertionError = require('./internal/assert/assertion_error');
3434
const { inspect } = require('util/');
3535
const { isPromise, isRegExp } = require('util/').types;
3636

37+
const objectAssign = Object.assign ? Object.assign : require('es6-object-assign').assign;
38+
3739
const errorCache = new Map();
3840

3941
let isDeepEqual;
@@ -594,7 +596,7 @@ assert.ifError = function ifError(err) {
594596
function strict(...args) {
595597
innerOk(strict, args.length, ...args);
596598
}
597-
assert.strict = Object.assign(strict, assert, {
599+
assert.strict = objectAssign(strict, assert, {
598600
equal: assert.strictEqual,
599601
deepEqual: assert.deepStrictEqual,
600602
notEqual: assert.notStrictEqual,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
},
3232
"dependencies": {
3333
"buffer": "^5.2.1",
34+
"es6-object-assign": "^1.1.0",
3435
"util": "^0.12.0"
3536
}
3637
}

0 commit comments

Comments
 (0)