mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -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());
|
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]
|
#[test]
|
||||||
fn repl_test_eof() {
|
fn repl_test_eof() {
|
||||||
let (out, err) = util::run_and_collect_output(
|
let (out, err) = util::run_and_collect_output(
|
||||||
|
|
|
@ -536,9 +536,11 @@ fn eval_context(
|
||||||
mut rv: v8::ReturnValue,
|
mut rv: v8::ReturnValue,
|
||||||
) {
|
) {
|
||||||
let state_rc = CoreIsolate::state(scope.isolate());
|
let state_rc = CoreIsolate::state(scope.isolate());
|
||||||
|
let context = {
|
||||||
let state = state_rc.borrow();
|
let state = state_rc.borrow();
|
||||||
assert!(!state.global_context.is_empty());
|
assert!(!state.global_context.is_empty());
|
||||||
let context = state.global_context.get(scope).unwrap();
|
state.global_context.get(scope).unwrap()
|
||||||
|
};
|
||||||
|
|
||||||
let source = match v8::Local::<v8::String>::try_from(args.get(0)) {
|
let source = match v8::Local::<v8::String>::try_from(args.get(0)) {
|
||||||
Ok(s) => s,
|
Ok(s) => s,
|
||||||
|
|
Loading…
Add table
Reference in a new issue