Skip to content

v1.18.0

Compare
Choose a tag to compare
@schungx schungx released this 12 Apr 05:15
· 87 commits to main since this release
5f2f243

Starting from this version, we try to put contributors' names on features/enhancements/fixes that they contributed.

We apologize for neglecting to adopt this practice earlier, but late is better than never!

Bug fixes

  • The position of an undefined operation call now points to the operator instead of the first operand.
  • The optimize command in rhai-repl now works properly and cycles through None->Simple->Full.
  • Engine::call_fn_XXX no longer return errors unnecessarily wrapped in EvalAltResult::ErrorInFunctionCall.
  • Some tests that panic on 32-bit architecture are fixed (thanks @alexanderkjall #851).
  • The optimizer no longer goes into an infinite loop when optimizing a try statement with an empty body.

Deprecated API's

  • The plugin macros export_fn, register_exported_fn!, set_exported_fn! and set_exported_global_fn! are deprecated because they do not add value over existing direct API's.

New features

  • Sub-strings can now be selected from full strings by indexing via ranges, e.g. s[1..4] (thanks @zitsen #845).
  • Doc-comments are now automatically added to function registrations and custom types via the CustomType derive macro (thanks @Itabis #847).
  • New options Engine::set_max_strings_interned and Engine::max_strings_interned are added to limit the maximum number of strings interned in the Engine's string interner.
  • A new advanced callback, Engine::on_invalid_array_index, is added (gated under the internals feature) to handle access to missing properties in object maps.
  • A new advanced callback, Engine::on_missing_map_property, is added (gated under the internals feature) to handle out-of-bound index into arrays.

Enhancements

  • parse_json is also available without the metadata or serde feature -- it uses Engine::parse_json to parse the JSON text (thanks @Mathieu-Lala #840).
  • FuncRegistration::in_global_namespace and FuncRegistration::in_internal_namespace are added to avoid pulling in FnNamespace.
  • Array/BLOB/string iterators are defined also within the BasicIteratorPackage in addition to the regular array/BLOB/string packages.
  • LexError::Runtime is added for use with Engine::on_parse_token.
  • Shared values under sync are now handled more elegantly -- instead of deadlocking and hanging indefinitely, it spins for a number of tries (waiting one second between each), then errors out.