Skip to content

Commit d6a56b8

Browse files
committed
add console log when require is blocked
1 parent 06ee01a commit d6a56b8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/tools/runner/vm_context_helper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ function createRestrictedRequire() {
3030
if (isAllowed) {
3131
// Allow access to the module if the requester is in the allowlist
3232
} else {
33+
console.log(
34+
`Access to core module '${moduleName}' from ${srcRelativePath} is restricted in this context (callStack: ${callStack}, sourceFile: ${sourceFile}, srcRelativePath: ${srcRelativePath})`
35+
);
3336
throw new Error(
3437
`Access to core module '${moduleName}' from ${srcRelativePath} is restricted in this context (callStack: ${callStack}, sourceFile: ${sourceFile}, srcRelativePath: ${srcRelativePath})`
3538
);

0 commit comments

Comments
 (0)