Commit 0d70c79
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 0d70c79Copy full SHA for 0d70c79
1 file changed
+2-6Lines changed: 2 additions & 6 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib/internal/assert
Expand file treeCollapse file tree
Open diff view settings
Collapse file
lib/internal/assert/assertion_error.js
Copy file name to clipboardExpand all lines: lib/internal/assert/assertion_error.js+2-6Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
| 9 | + |
9 | 10 | |
10 | 11 | |
11 | | - |
12 | 12 | |
13 | 13 | |
14 | 14 | |
| ||
46 | 46 | |
47 | 47 | |
48 | 48 | |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
| 49 | + |
54 | 50 | |
55 | 51 | |
56 | 52 | |
|
0 commit comments