Repository: denoland/deno
Pull request: fix(core): handle dyn imports exceeding call stack size

Fixes https://github.com/denoland/deno/issues/27736

Changed files:
filename: Cargo.lock
patch: @@ -1548,9 +1548,9 @@ dependencies = [
 
 [[package]]
 name = "deno_core"
-version = "0.331.0"
+version = "0.333.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce2d1779358cad2bc56d71176298767be628d707bb75585f6f8a4be2da8ccda1"
+checksum = "2e67f6f874401f3b8fb3e851743c40ee14014648db6685b233b34f783f6959e8"
 dependencies = [
  "anyhow",
  "az",
@@ -1563,6 +1563,7 @@ dependencies = [
  "deno_core_icudata",
  "deno_error",
  "deno_ops",
+ "deno_path_util",
  "deno_unsync",
  "futures",
  "indexmap 2.3.0",
@@ -2176,9 +2177,9 @@ dependencies = [
 
 [[package]]
 name = "deno_ops"
-version = "0.207.0"
+version = "0.209.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96f000a21f6969b4c945bc8e9e785aa439f11ca4fd3fbddcd5bebc102167eb37"
+checksum = "fbda741ba267a252bad86153d16c859c3a8e1b219b300a1b4f0a2632c0a465cf"
 dependencies = [
  "indexmap 2.3.0",
  "proc-macro-rules",
@@ -7000,9 +7001,9 @@ dependencies = [
 
 [[package]]
 name = "serde_v8"
-version = "0.240.0"
+version = "0.242.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd0494d74c40ab94f53a19485de359ea6a55f05341b817b93440b673c1ce8ec6"
+checksum = "aa9d64ec1fdc3316cb65ca60ccbb5a3a914f014ccb0b5f71fc9280506fd28247"
 dependencies = [
  "deno_error",
  "num-bigint",

filename: Cargo.toml
patch: @@ -51,7 +51,7 @@ repository = "https://github.com/denoland/deno"
 
 [workspace.dependencies]
 deno_ast = { version = "=0.44.0", features = ["transpiling"] }
-deno_core = { version = "0.331.0" }
+deno_core = { version = "0.333.0" }
 
 deno_bench_util = { version = "0.181.0", path = "./bench_util" }
 deno_config = { version = "=0.45.0", features = ["workspace"] }

filename: cli/module_loader.rs
patch: @@ -606,12 +606,13 @@ impl<TGraphContainer: ModuleGraphContainer>
     } else if referrer == "." {
       // main module, use the initial cwd
       deno_core::resolve_path(referrer, &self.shared.initial_cwd)
-        .map_err(|e| e.into())
+        .map_err(|e| JsErrorBox::from_err(e).into())
     } else {
       // this cwd check is slow, so try to avoid it
       let cwd = std::env::current_dir()
         .map_err(|e| JsErrorBox::from_err(UnableToGetCwdError(e)))?;
-      deno_core::resolve_path(referrer, &cwd).map_err(|e| e.into())
+      deno_core::resolve_path(referrer, &cwd)
+        .map_err(|e| JsErrorBox::from_err(e).into())
     }
   }
 

filename: cli/rt/run.rs
patch: @@ -164,7 +164,8 @@ impl ModuleLoader for EmbeddedModuleLoader {
         );
       }
       let current_dir = std::env::current_dir().unwrap();
-      deno_core::resolve_path(".", &current_dir)?
+      deno_core::resolve_path(".", &current_dir)
+        .map_err(JsErrorBox::from_err)?
     } else {
       Url::parse(referrer).map_err(|err| {
         JsErrorBox::type_error(format!(

filename: cli/tsc/mod.rs
patch: @@ -529,6 +529,9 @@ pub enum LoadError {
   #[error("Unable to load {path}: {error}")]
   LoadFromNodeModule { path: String, error: std::io::Error },
   #[class(inherit)]
+  #[error("{0}")]
+  ResolveUrlOrPathError(#[from] deno_path_util::ResolveUrlOrPathError),
+  #[class(inherit)]
   #[error(
     "Error converting a string module specifier for \"op_resolve\": {0}"
   )]
@@ -710,6 +713,9 @@ pub enum ResolveError {
   PackageSubpathResolve(PackageSubpathResolveError),
   #[class(inherit)]
   #[error("{0}")]
+  ResolveUrlOrPathError(#[from] deno_path_util::ResolveUrlOrPathError),
+  #[class(inherit)]
+  #[error("{0}")]
   ResolvePkgFolderFromDenoModule(#[from] ResolvePkgFolderFromDenoModuleError),
   #[class(inherit)]
   #[error("{0}")]