From b8b6964bc9dc016824b8f445a3d772db4832b298 Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Fri, 2 Nov 2018 23:45:57 +0000 Subject: [PATCH] bug fixes --- src/lib/exec.rs | 19 +++++++++---------- src/lib/js/value.rs | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/lib/exec.rs b/src/lib/exec.rs index b2a4c2792f..bea329df02 100644 --- a/src/lib/exec.rs +++ b/src/lib/exec.rs @@ -200,18 +200,17 @@ impl Executor for Interpreter { let mut matched = false; for tup in vals.iter() { let tup: &(Expr, Vec) = tup; - match *tup { - (ref cond, ref block) if (val == try!(self.run(cond))) => { - matched = true; - let last_expr = block.last().unwrap(); - for expr in block.iter() { - let e_result = try!(self.run(expr)); - if expr == last_expr { - result = e_result; - } + let cond = &tup.0; + let block = &tup.1; + if val == try!(self.run(cond)) { + matched = true; + let last_expr = block.last().unwrap(); + for expr in block.iter() { + let e_result = try!(self.run(expr)); + if expr == last_expr { + result = e_result; } } - _ => (), } } if !matched && default.is_some() { diff --git a/src/lib/js/value.rs b/src/lib/js/value.rs index 478f56ed7d..7d5c260c8f 100644 --- a/src/lib/js/value.rs +++ b/src/lib/js/value.rs @@ -193,10 +193,10 @@ impl ValueData { ValueData::Function(ref func) => { match *func.borrow_mut().deref_mut() { Function::NativeFunc(ref mut f) => { - f.object.insert(field.clone(), Property::new(val)) + f.object.insert(field.clone(), Property::new(val.clone())) } Function::RegularFunc(ref mut f) => { - f.object.insert(field.clone(), Property::new(val)) + f.object.insert(field.clone(), Property::new(val.clone())) } }; }