Skip to content

Commit

Permalink
lib: remove deprecated string methods
Browse files Browse the repository at this point in the history
PR-URL: #50592
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
MrJithil authored and UlisesGascon committed Dec 11, 2023
1 parent 7b9b1fb commit fa220ca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/_http_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const {
StringPrototypeIndexOf,
StringPrototypeSplit,
StringPrototypeStartsWith,
StringPrototypeSubstr,
StringPrototypeSubstring,
Symbol,
} = primordials;

Expand Down Expand Up @@ -363,7 +363,7 @@ function calculateServerName(options, req) {
// Leading '[', but no ']'. Need to do something...
servername = hostHeader;
} else {
servername = StringPrototypeSubstr(hostHeader, 1, index - 1);
servername = StringPrototypeSubstring(hostHeader, 1, index);
}
} else {
servername = StringPrototypeSplit(hostHeader, ':', 1)[0];
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/main/print_help.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
RegExpPrototypeSymbolReplace,
StringPrototypeLocaleCompare,
StringPrototypeSlice,
StringPrototypeTrimLeft,
StringPrototypeTrimStart,
StringPrototypeRepeat,
SafeMap,
} = primordials;
Expand Down Expand Up @@ -180,7 +180,7 @@ function format(
else
text += StringPrototypeRepeat(' ', firstColumn - displayName.length);

text += StringPrototypeTrimLeft(
text += StringPrototypeTrimStart(
indent(fold(displayHelpText, secondColumn), firstColumn)) + '\n';
}

Expand Down
4 changes: 2 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const {
StringPrototypeSplit,
StringPrototypeStartsWith,
StringPrototypeTrim,
StringPrototypeTrimLeft,
StringPrototypeTrimStart,
StringPrototypeToLocaleLowerCase,
Symbol,
SyntaxError,
Expand Down Expand Up @@ -1326,7 +1326,7 @@ function complete(line, callback) {
let completeOn, group;

// Ignore right whitespace. It could change the outcome.
line = StringPrototypeTrimLeft(line);
line = StringPrototypeTrimStart(line);

let filter = '';

Expand Down

0 comments on commit fa220ca

Please sign in to comment.