0
0
Fork 0
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:
Ryan Dahl 2020-06-02 16:37:52 -04:00 committed by GitHub
parent b7b6e0674f
commit 23dc9c13db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View file

@ -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(

View file

@ -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,