summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm/registry/@denotest/permissions-outside-package/1.0.0/index.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-01-10 14:35:44 +0100
committerGitHub <noreply@github.com>2023-01-10 14:35:44 +0100
commit636352e0ca1e611c7673f2ab68538e1ddb2dc5b7 (patch)
treec250c7a74917cef683999e06283ea9f7182f372c /cli/tests/testdata/npm/registry/@denotest/permissions-outside-package/1.0.0/index.js
parent45768f0e832e54d61ddb5a62d62239aef0e597b5 (diff)
fix(npm): allow to read package.json if permissions are granted (#17209)
This commit changes signature of "deno_core::ModuleLoader::resolve" to pass an enum indicating whether or not we're resolving a specifier for dynamic import. Additionally "CliModuleLoader" was changes to store both "parent permissions" (or "root permissions") as well as "dynamic permissions" that allow to check for permissions in top-level module load an dynamic imports. Then all code paths that have anything to do with Node/npm compat are now checking for permissions which are passed from module loader instance associated with given worker.
Diffstat (limited to 'cli/tests/testdata/npm/registry/@denotest/permissions-outside-package/1.0.0/index.js')
-rw-r--r--cli/tests/testdata/npm/registry/@denotest/permissions-outside-package/1.0.0/index.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/tests/testdata/npm/registry/@denotest/permissions-outside-package/1.0.0/index.js b/cli/tests/testdata/npm/registry/@denotest/permissions-outside-package/1.0.0/index.js
new file mode 100644
index 000000000..ec854713f
--- /dev/null
+++ b/cli/tests/testdata/npm/registry/@denotest/permissions-outside-package/1.0.0/index.js
@@ -0,0 +1,5 @@
+function loadConfigFile(fileName) {
+ return require(fileName);
+}
+
+module.exports.loadConfigFile = loadConfigFile; \ No newline at end of file