GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — path: remove `StringPrototypeCharCodeAt` from `posix.extname` · nodejs/node@309cb1c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • path.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/path.js‎

Copy file name to clipboardExpand all lines: lib/path.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,8 +1463,8 @@ const posix = {
14631463
// after any path separator we find
14641464
let preDotState = 0;
14651465
for (let i = path.length - 1; i >= 0; --i) {
1466-
const code = StringPrototypeCharCodeAt(path, i);
1467-
if (code === CHAR_FORWARD_SLASH) {
1466+
const char = path[i];
1467+
if (char === '/') {
14681468
// If we reached a path separator that was not part of a set of path
14691469
// separators at the end of the string, stop now
14701470
if (!matchedSlash) {
@@ -1479,7 +1479,7 @@ const posix = {
14791479
matchedSlash = false;
14801480
end = i + 1;
14811481
}
1482-
if (code === CHAR_DOT) {
1482+
if (char === '.') {
14831483
// If this is our first dot, mark it as the start of our extension
14841484
if (startDot === -1)
14851485
startDot = i;

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.