summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/ops/runtime_compiler.rs12
-rw-r--r--cli/tests/integration/run_tests.rs18
-rw-r--r--cli/tests/testdata/issue12453.js4
3 files changed, 31 insertions, 3 deletions
diff --git a/cli/ops/runtime_compiler.rs b/cli/ops/runtime_compiler.rs
index ab6992d19..8f7a75146 100644
--- a/cli/ops/runtime_compiler.rs
+++ b/cli/ops/runtime_compiler.rs
@@ -88,9 +88,15 @@ async fn op_emit(
) -> Result<EmitResult, AnyError> {
deno_runtime::ops::check_unstable2(&state, "Deno.emit");
let root_specifier = args.root_specifier;
- let state = state.borrow();
- let ps = state.borrow::<ProcState>();
- let mut runtime_permissions = { state.borrow::<Permissions>().clone() };
+ let ps = {
+ let state = state.borrow();
+ state.borrow::<ProcState>().clone()
+ };
+ let mut runtime_permissions = {
+ let state = state.borrow();
+ state.borrow::<Permissions>().clone()
+ };
+
let mut cache: Box<dyn cache::CacherLoader> =
if let Some(sources) = &args.sources {
Box::new(cache::MemoryCacher::new(sources.clone()))
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs
index ec42a8dc8..b7480c44b 100644
--- a/cli/tests/integration/run_tests.rs
+++ b/cli/tests/integration/run_tests.rs
@@ -2148,3 +2148,21 @@ itest!(eval_context_throw_dom_exception {
args: "run eval_context_throw_dom_exception.js",
output: "eval_context_throw_dom_exception.js.out",
});
+
+#[test]
+fn issue12453() {
+ let _g = util::http_server();
+ let deno_dir = util::new_deno_dir();
+ let mut deno_cmd = util::deno_cmd_with_deno_dir(deno_dir.path());
+ let status = deno_cmd
+ .current_dir(util::testdata_path())
+ .arg("run")
+ .arg("--unstable")
+ .arg("--allow-net")
+ .arg("issue12453.js")
+ .spawn()
+ .unwrap()
+ .wait()
+ .unwrap();
+ assert!(status.success());
+}
diff --git a/cli/tests/testdata/issue12453.js b/cli/tests/testdata/issue12453.js
new file mode 100644
index 000000000..2ed1b5ae7
--- /dev/null
+++ b/cli/tests/testdata/issue12453.js
@@ -0,0 +1,4 @@
+const i = setInterval(() => {
+ Deno.emit("http://localhost:4545/subdir/mt_text_typescript.t1.ts");
+ clearInterval(i);
+}, 1);