Commit 6f80c9a6 authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[mjsunit] Prevent module test from accidentally loading common files

- Disable automatic module file extensions for the test
- Use uncommon name suffix to prevent accidental loading of an
  existing file

Change-Id: I26c1092a1e559cbbebce442a8d5ff3fb6dd5aa84
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3122145Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76616}
parent 64c80878
......@@ -4379,8 +4379,9 @@ bool Shell::SetOptions(int argc, char* argv[]) {
options.fuzzilli_coverage_statistics = true;
argv[i] = nullptr;
#endif
} else if (strcmp(argv[i], "--fuzzy-module-file-extensions") == 0) {
options.fuzzy_module_file_extensions = true;
} else if (strcmp(argv[i], "--no-fuzzy-module-file-extensions") == 0) {
DCHECK(options.fuzzy_module_file_extensions);
options.fuzzy_module_file_extensions = false;
argv[i] = nullptr;
#if defined(V8_ENABLE_SYSTEM_INSTRUMENTATION)
} else if (strcmp(argv[i], "--enable-system-instrumentation") == 0) {
......
......@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --no-fuzzy-module-file-extensions
const paths = [
".",
"..",
......@@ -15,7 +17,8 @@ const paths = [
"./../..",
];
const results = await Promise.allSettled(paths.map(path => import(path)));
const results = await Promise.allSettled(
paths.map(path => import(path + "/___._._")));
for (let result of results) {
assertEquals(result.status, 'rejected');
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment