Version Control
The ahash crate that Rhai depends on has a breaking change since version 0.8.12 which bumps getrandom to version 0.3, braking certain no-std and wasm builds.
Version 1.23.3: Use this version when building for no-std
Version 1.23.4: This is the main version for std builds.
Bug fixes
- (Fuzzing) Fixed crash when using
..=in arrays, BLOB's, bit-fields and iterators (#1004). - Modules loaded within a
ModuleResolversCollectionnow properly enable access to thescopeetc. - Registered functions for comparison operators with only one operand being a custom type now works properly (thanks
@mkeeter#1003). NativeCallContext::fn_sourcenow correctly returns the source of the function (usuallyNone). The missingNativeCallContext::call_sourceis added to return the source of caller (thanks@FlashSystems#1013).Engine::collect_fn_metadatanow properly includes functions registered into the global namespace (thanks@therealprofand@matthiasbeyer#1017).
Enhancements
build.rsno longer writes to the source tree butOUT_DIRinstead (thanks@matthiasbeyer#1018)CustomTypederive macro now supports generic types (thanks@ProphetOSpam#999). Therhai_codegencrate dependency is bumped to3.0.0or later.CustomTypederive macro now handlesOptionfields (thanks@agersant#1011).Engine::eval_fn_callis added to make a generic function call.Engine::eval_binary_opis added to quickly compare twoDynamicvalues.- Better handling for 32-bit architectures and enhanced safety by replacing casts with
try_from(thanks@therealprof#1009). - The new symbol types
$token$,$inner$, and$raw$can now be used in custom syntax definitions (#1023). Engine::register_custom_syntax_without_look_ahead_rawis added to allow the use of$raw$in custom syntax, which returns the script text character-by-character without processing, by-passing the tokenizer. This in turn allows for parsing arbitrary syntax. (#1022)CallFnOptions::in_all_namespacesis added to allow calling functions in all namespaces, instead of only scripted Rhai functions in theAST.