Rhai v1.8.0 Release Notes
-
🐛 Bug fixes
- Self-contained
AST
now works properly withEngine::call_fn
. - Missing
to_int
fromDecimal
is added. - 📜 Parsing of index expressions is relaxed and many cases no longer result in an index-type error to allow for custom indexers.
- 🔀 Merging or combining a self-contained
AST
into anotherAST
now works properly. - 🔌 Plugin modules/functions no longer generate errors under
#![deny(missing_docs)]
. - Calling a property on a function call that returns a shared value no longer causes an error.
- Strict Variables Mode now checks for module namespaces within functions as well.
- Module defined via
Engine::register_static_module
are now checked in Strict Variables Mode.
Reserved Symbols
?
,??
,?.
,?[
and!.
are now reserved symbols.
🗄 Deprecated API's
- 🗄
FnPtr::num_curried
is deprecated in favor ofFnPtr::curry().len()
.
🆕 New features
- The Elvis operators (
?.
and?[
) are now supported for property access, method calls and indexing. - The null-coalescing operator (
??
) is now supported to short-circuit()
values.
✨ Enhancements
- Indexing and property access are now faster.
EvalAltResult::IndexNotFound
is added to aid in raising errors for indexers.- 🏷
Engine::def_tag
,Engine::def_tag_mut
andEngine::set_tag
are added to manage a default value for the custom evaluation state, accessible viaEvalState::tag()
(which is the same asNativeCallContext::tag()
). - Originally, the debugger's custom state uses the same state as
EvalState::tag()
(which is the same asNativeCallContext::tag()
). It is now split into its own variable accessible underDebugger::state()
. - Non-borrowed string keys can now be deserialized for object maps via
serde
. Scope::get
is added to get a reference to a variable's value.- Variable resolvers can now return a shared value which can be mutated.
- Self-contained