summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/internal/process/permission.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/internal/process/permission.js b/lib/internal/process/permission.js
index 4b48493adc..e400dcae9f 100644
--- a/lib/internal/process/permission.js
+++ b/lib/internal/process/permission.js
@@ -2,6 +2,7 @@
const {
ObjectFreeze,
+ StringPrototypeStartsWith,
} = primordials;
const permission = internalBinding('permission');
@@ -24,8 +25,10 @@ module.exports = ObjectFreeze({
if (reference != null) {
// TODO: add support for WHATWG URLs and Uint8Arrays.
validateString(reference, 'reference');
- if (!isAbsolute(reference)) {
- return permission.has(scope, resolve(reference));
+ if (StringPrototypeStartsWith(scope, 'fs')) {
+ if (!isAbsolute(reference)) {
+ reference = resolve(reference);
+ }
}
}