| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -539,7 +539,7 @@ function readPolicyFromDisk() { | |||
| 539 | 539 | // no bare specifiers for now | |
| 540 | 540 | let manifestURL; | |
| 541 | 541 | if (require('path').isAbsolute(experimentalPolicy)) { | |
| 542 | - manifestURL = new URL(`file://${experimentalPolicy}`); | ||
| 542 | + manifestURL = pathToFileURL(experimentalPolicy); | ||
| 543 | 543 | } else { | |
| 544 | 544 | const cwdURL = pathToFileURL(process.cwd()); | |
| 545 | 545 | cwdURL.pathname += '/'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,9 @@ common.requireNoPackageJSONAbove(); | |||
| 9 | 9 | ||
| 10 | 10 | const assert = require('assert'); | |
| 11 | 11 | const { spawnSync } = require('child_process'); | |
| 12 | + const { cpSync, rmSync } = require('fs'); | ||
| 12 | 13 | const fixtures = require('../common/fixtures.js'); | |
| 14 | + const tmpdir = require('../common/tmpdir.js'); | ||
| 13 | 15 | ||
| 14 | 16 | { | |
| 15 | 17 | const policyFilepath = fixtures.path('policy-manifest', 'invalid.json'); | |
@@ -25,6 +27,23 @@ const fixtures = require('../common/fixtures.js'); | |||
| 25 | 27 | assert.match(stderr, /pattern needs to have a single trailing "\*"/); | |
| 26 | 28 | } | |
| 27 | 29 | ||
| 30 | + { | ||
| 31 | + tmpdir.refresh(); | ||
| 32 | + const policyFilepath = tmpdir.resolve('file with % in its name.json'); | ||
| 33 | + cpSync(fixtures.path('policy-manifest', 'invalid.json'), policyFilepath); | ||
| 34 | + const result = spawnSync(process.execPath, [ | ||
| 35 | + '--experimental-policy', | ||
| 36 | + policyFilepath, | ||
| 37 | + './fhqwhgads.js', | ||
| 38 | + ]); | ||
| 39 | + | ||
| 40 | + assert.notStrictEqual(result.status, 0); | ||
| 41 | + const stderr = result.stderr.toString(); | ||
| 42 | + assert.match(stderr, /ERR_MANIFEST_INVALID_SPECIFIER/); | ||
| 43 | + assert.match(stderr, /pattern needs to have a single trailing "\*"/); | ||
| 44 | + rmSync(policyFilepath); | ||
| 45 | + } | ||
| 46 | + | ||
| 28 | 47 | { | |
| 29 | 48 | const policyFilepath = fixtures.path('policy-manifest', 'onerror-exit.json'); | |
| 30 | 49 | const result = spawnSync(process.execPath, [ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments