Commit ed72d83
crypto: simplify KeyObject constructor
Inline a function that only gets called in the constructor. Make call to
`super()` more straightforward in the process by removing conditional
involving the function as it only ever returns `undefined` or else
throws. That made the code a little hard to understand, as without
looking at the function, one would likely expect it to return `true`
on success rather than `undefined`.
PR-URL: #35064
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent 090f869 commit ed72d83Copy full SHA for ed72d83
File tree
Expand file treeCollapse file tree
1 file changed
+6
-8
lines changedOpen diff view settings
Filter options
- lib/internal/crypto
Expand file treeCollapse file tree
1 file changed
+6
-8
lines changedOpen diff view settings
Collapse file
lib/internal/crypto/keys.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/keys.js+6-8Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
43 | 43 | |
44 | 44 | |
45 | 45 | |
46 | | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | 46 | |
54 | 47 | |
55 | 48 | |
| ||
64 | 57 | |
65 | 58 | |
66 | 59 | |
67 | | - |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
68 | 66 | |
69 | 67 | |
70 | 68 | |
|
0 commit comments