Commit 8057315
util: make inherits work with classes
The current implementation overwrites the prototype of the target
constructor. It is not allowed with ES2015 classes because the prototype
property is read only. Use Object.setPrototypeOf instead.
Fixes: #3452
PR-URL: #3455
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent c9786bb commit 8057315Copy full SHA for 8057315
File tree
Expand file treeCollapse file tree
2 files changed
+35
-8
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+35
-8
lines changedOpen diff view settings
Collapse file
+1-8Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
761 | 761 | |
762 | 762 | |
763 | 763 | |
764 | | - |
765 | | - |
766 | | - |
767 | | - |
768 | | - |
769 | | - |
770 | | - |
771 | | - |
| 764 | + |
772 | 765 | |
773 | 766 | |
774 | 767 | |
|
Collapse file
test/parallel/test-util-inherits.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inherits.js+34Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
40 | 40 | |
41 | 41 | |
42 | 42 | |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
43 | 77 | |
44 | 78 | |
45 | 79 | |
|
0 commit comments