Merge branch 'master' into namespace

This commit is contained in:
Stephen Chung
2020-05-04 18:06:39 +08:00
2 changed files with 15 additions and 2 deletions

View File

@@ -936,7 +936,11 @@ impl Engine {
let fn_name = make_setter(id);
// Reuse args because the first &mut parameter will not be consumed
args[1] = indexed_val;
self.exec_fn_call(fn_lib, &fn_name, &mut args, None, *pos, 0)?;
self.exec_fn_call(fn_lib, &fn_name, &mut args, None, *pos, 0).or_else(|err| match *err {
// If there is no setter, no need to feed it back because the property is read-only
EvalAltResult::ErrorDotExpr(_,_) => Ok(Default::default()),
err => Err(Box::new(err))
})?;
}
}