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 — permission: resolve reference to absolute path only for fs permission · nodejs/node@af86625

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/process
    • permission.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/process/permission.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/permission.js
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
ObjectFreeze,
5+
StringPrototypeStartsWith,
56
} = primordials;
67

78
const permission = internalBinding('permission');
@@ -24,8 +25,10 @@ module.exports = ObjectFreeze({
2425
if (reference != null) {
2526
// TODO: add support for WHATWG URLs and Uint8Arrays.
2627
validateString(reference, 'reference');
27-
if (!isAbsolute(reference)) {
28-
return permission.has(scope, resolve(reference));
28+
if (StringPrototypeStartsWith(scope, 'fs')) {
29+
if (!isAbsolute(reference)) {
30+
reference = resolve(reference);
31+
}
2932
}
3033
}
3134

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.