Skip to content

Commit 9640661

Browse files
aduh95marco-ippolito
authored andcommitted
test: fix test-vm-context-dont-contextify when path contains a space
Because of the double encoding, the test would fail as soon as the path contains a space or any other char that's already encoded by `pathToFileURL`. PR-URL: #55026 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6e5d524 commit 9640661

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-vm-context-dont-contextify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function checkFrozen(context) {
176176
const namespace = await import(moduleUrl.href);
177177
// Check dynamic import works
178178
const context = vm.createContext(vm.constants.DONT_CONTEXTIFY);
179-
const script = new vm.Script(`import('${encodeURI(moduleUrl.href)}')`, {
179+
const script = new vm.Script(`import(${JSON.stringify(moduleUrl)})`, {
180180
importModuleDynamically: vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER,
181181
});
182182
const promise = script.runInContext(context);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy