lib: optimize copyError with ObjectAssign in primordials · nodejs/node@0d70c79 · GitHub
Skip to content

Commit 0d70c79

Browse files
rayark1marco-ippolito
authored andcommitted
lib: optimize copyError with ObjectAssign in primordials
optimized the copyError function by using ObjectAssign from primordials. this change replaces the for-loop with ObjectAssign, which improves memory usage and performance. this change updates the copyError function in internal/assert.js to use ObjectAssign for copying properties. PR-URL: #53999 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
1 parent bfabfb4 commit 0d70c79

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

lib/internal/assert/assertion_error.js

Lines changed: 2 additions & 6 deletions

0 commit comments

Comments
 (0)