diff --git a/RELEASES.md b/RELEASES.md index 3d57b32e..0f3e37d5 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -8,19 +8,20 @@ This version streamlines compiling for WASM. Rust compiler minimum version is raised to 1.49. -Breaking changes ----------------- - -* Rust compiler requirement raised to 1.49. -* `NativeCallContext::new` taker an additional parameter containing the name of the function called. -* `Engine::set_doc_comments` is renamed `Engine::enable_doc_comments`. - Bug fixes --------- * Parameters passed to plugin module functions were sometimes erroneously consumed. This is now fixed. * Fixes compilation errors in `metadata` feature build. * Stacking `!` operators now work properly. +* Off-by-one error in `insert` method for arrays is fixed. + +Breaking changes +---------------- + +* Rust compiler requirement raised to 1.49. +* `NativeCallContext::new` taker an additional parameter containing the name of the function called. +* `Engine::set_doc_comments` is renamed `Engine::enable_doc_comments`. New features ------------ diff --git a/src/packages/array_basic.rs b/src/packages/array_basic.rs index 6247e881..95b61dcc 100644 --- a/src/packages/array_basic.rs +++ b/src/packages/array_basic.rs @@ -29,7 +29,7 @@ macro_rules! gen_array_functions { pub fn insert(list: &mut Array, position: INT, item: $arg_type) { if position <= 0 { list.insert(0, Dynamic::from(item)); - } else if (position as usize) >= list.len() - 1 { + } else if (position as usize) >= list.len() { push(list, item); } else { list.insert(position as usize, Dynamic::from(item));