From f602d63f48067851716d46184746ce26b2e674ba Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Fri, 1 Oct 2021 00:25:58 +0900 Subject: fix(repl): avoid panic when assigned to globalThis (#12273) --- cli/tests/integration/repl_tests.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cli/tests') diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index a8f354598..3dd5699c6 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -134,6 +134,17 @@ fn pty_ignore_symbols() { }); } +#[test] +fn pty_assign_global_this() { + util::with_pty(&["repl"], |mut console| { + console.write_line("globalThis = 42;"); + console.write_line("close();"); + + let output = console.read_all_output(); + assert!(!output.contains("panicked")); + }); +} + #[test] fn console_log() { let (out, err) = util::run_and_collect_output( -- cgit v1.2.3