Skip to content

Commit 6a701c9

Browse files
committed
lib: replace native methods with primordials
Replace native methods with primordials.
1 parent 879b95e commit 6a701c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/socketaddress.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
ObjectSetPrototypeOf,
5+
StringPrototypeSlice,
56
Symbol,
67
} = primordials;
78

@@ -159,7 +160,7 @@ class SocketAddress {
159160
} = URLParse(`http://${input}`);
160161
if (address.startsWith('[') && address.endsWith(']')) {
161162
return new SocketAddress({
162-
address: address.slice(1, -1),
163+
address: StringPrototypeSlice(address, 1, -1),
163164
port: port | 0,
164165
family: 'ipv6',
165166
});

0 commit comments

Comments
 (0)