mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
Fix REPL BorrowMutError panic (#6055)
This commit is contained in:
parent
b7b6e0674f
commit
23dc9c13db
2 changed files with 17 additions and 3 deletions
|
@ -745,6 +745,18 @@ fn repl_test_console_log() {
|
|||
assert!(err.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn repl_cwd() {
|
||||
let (_out, err) = util::run_and_collect_output(
|
||||
true,
|
||||
"repl",
|
||||
Some(vec!["Deno.cwd()"]),
|
||||
Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]),
|
||||
false,
|
||||
);
|
||||
assert!(err.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn repl_test_eof() {
|
||||
let (out, err) = util::run_and_collect_output(
|
||||
|
|
|
@ -536,9 +536,11 @@ fn eval_context(
|
|||
mut rv: v8::ReturnValue,
|
||||
) {
|
||||
let state_rc = CoreIsolate::state(scope.isolate());
|
||||
let state = state_rc.borrow();
|
||||
assert!(!state.global_context.is_empty());
|
||||
let context = state.global_context.get(scope).unwrap();
|
||||
let context = {
|
||||
let state = state_rc.borrow();
|
||||
assert!(!state.global_context.is_empty());
|
||||
state.global_context.get(scope).unwrap()
|
||||
};
|
||||
|
||||
let source = match v8::Local::<v8::String>::try_from(args.get(0)) {
|
||||
Ok(s) => s,
|
||||
|
|
Loading…
Add table
Reference in a new issue