v1.18.0
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 inrhai-repl
now works properly and cycles throughNone
->Simple
->Full
. Engine::call_fn_XXX
no longer return errors unnecessarily wrapped inEvalAltResult::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!
andset_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
andEngine::max_strings_interned
are added to limit the maximum number of strings interned in theEngine
's string interner. - A new advanced callback,
Engine::on_invalid_array_index
, is added (gated under theinternals
feature) to handle access to missing properties in object maps. - A new advanced callback,
Engine::on_missing_map_property
, is added (gated under theinternals
feature) to handle out-of-bound index into arrays.
Enhancements
parse_json
is also available without themetadata
orserde
feature -- it usesEngine::parse_json
to parse the JSON text (thanks@Mathieu-Lala
#840).FuncRegistration::in_global_namespace
andFuncRegistration::in_internal_namespace
are added to avoid pulling inFnNamespace
.- 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 withEngine::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.