Skip to content

Commit

Permalink
lib: combine ObjectAssign into a single statement in copyError
Browse files Browse the repository at this point in the history
Changed the assignment of 'target' to use a single ObjectAssign statement.
  • Loading branch information
rayark1 committed Jul 23, 2024
1 parent 0d74220 commit 8b70d36
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/internal/assert/assertion_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ const kReadableOperator = {
const kMaxShortLength = 12;

function copyError(source) {
const target = { __proto__: ObjectGetPrototypeOf(source) };
ObjectAssign(target, source);
const target = ObjectAssign({ __proto__: ObjectGetPrototypeOf(source) }, source);
ObjectDefineProperty(target, 'message', { __proto__: null, value: source.message });
return target;
}
Expand Down

0 comments on commit 8b70d36

Please sign in to comment.