-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
path: remove StringPrototypeCharCodeAt
from some methods of posix
#54668
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the commit message / title is a bit misleading, as this isn't removing the primordial everywhere, maybe reword?
lib/path.js
Outdated
@@ -1543,8 +1540,8 @@ const posix = { | |||
|
|||
// Get non-dir info | |||
for (; i >= start; --i) { | |||
const code = StringPrototypeCharCodeAt(path, i); | |||
if (code === CHAR_FORWARD_SLASH) { | |||
const code = path[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this variable to char
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied it!
Remove `StringPrototypeCharCodeAt` from `posix.resolve`, `posix.normalize`, `posix.parse`
StringPrototypeCharCodeAt
from lib/path
StringPrototypeCharCodeAt
from some methods of posix
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #54668 +/- ##
=======================================
Coverage 87.33% 87.33%
=======================================
Files 650 650
Lines 182842 182839 -3
Branches 35067 35059 -8
=======================================
+ Hits 159683 159688 +5
- Misses 16418 16424 +6
+ Partials 6741 6727 -14
|
CI: https://ci.nodejs.org/job/node-test-pull-request/61752/ Benchmark CI ( Results
|
Refs: #54546