summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/napi/lib.rs6
-rw-r--r--ext/node/polyfills/process.ts4
2 files changed, 8 insertions, 2 deletions
diff --git a/ext/napi/lib.rs b/ext/napi/lib.rs
index 402785ce8..829839838 100644
--- a/ext/napi/lib.rs
+++ b/ext/napi/lib.rs
@@ -9,6 +9,7 @@ use core::ptr::NonNull;
use deno_core::error::type_error;
use deno_core::error::AnyError;
use deno_core::op2;
+use deno_core::url::Url;
use deno_core::ExternalOpsTracker;
use deno_core::OpState;
use deno_core::V8CrossThreadTaskSpawner;
@@ -528,7 +529,10 @@ where
let type_tag = v8::Private::new(scope, Some(type_tag_name));
let type_tag = v8::Global::new(scope, type_tag);
- let env_shared = EnvShared::new(napi_wrap, type_tag, path.clone());
+ let url_filename =
+ Url::from_file_path(&path).map_err(|_| type_error("Invalid path"))?;
+ let env_shared =
+ EnvShared::new(napi_wrap, type_tag, format!("{url_filename}\0"));
let ctx = scope.get_current_context();
let mut env = Env::new(
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts
index bec62122b..02837f827 100644
--- a/ext/node/polyfills/process.ts
+++ b/ext/node/polyfills/process.ts
@@ -403,7 +403,9 @@ Process.prototype.chdir = chdir;
/** https://nodejs.org/api/process.html#processconfig */
Process.prototype.config = {
- target_defaults: {},
+ target_defaults: {
+ default_configuration: "Release",
+ },
variables: {},
};