Disallow registering indexers for arrays, maps and strings.

This commit is contained in:
Stephen Chung
2020-09-22 17:57:56 +08:00
parent 870ff81203
commit 594dcc3a06
7 changed files with 156 additions and 21 deletions

View File

@@ -756,10 +756,7 @@ impl Engine {
Err(err) => match *err {
// No index getter - try to call an index setter
#[cfg(not(feature = "no_index"))]
EvalAltResult::ErrorIndexingType(_, _) => {
// Raise error if there is no index getter nor setter
Some(new_val.unwrap())
}
EvalAltResult::ErrorIndexingType(_, _) => Some(new_val.unwrap()),
// Any other error - return
err => return Err(Box::new(err)),
},