v1.7.0
This release is primarily minor functionality and API enhancements.
Bug fixes
- Compound assignments now work properly with indexers.
- Cloning a
Scopeno longer turns all constants to mutable.
Script-breaking changes
- Strict Variables Mode no longer returns an error when an undeclared variable matches a variable/constant in the provided external
Scope.
Potentially breaking API changes
- The
Engine::on_varandEngine::on_parse_tokenAPI's are now marked unstable/volatile. - The closures passed to
Engine::on_var,Engine::on_def_varandEngine::register_debuggertakeEvalContextinstead of&EvalContextor&mut EvalContext. - The following enum's are marked
non_exhaustive:AccessMode,FnAccess,FnNamespace,FnMetadata,OptimizationLevel
New API
Module::eval_ast_as_new_rawis made public as a low-level API.format_map_as_jsonis provided globally, which is the same asto_jsonfor object maps.Engine::call_fn_raw_rawis added to add speed to repeated function calls.Engine::eval_statements_rawis added to evaluate a sequence of statements.
New features
- A custom state is provided that is persistent during the entire evaluation run. This custom state is a
Dynamic, which can hold any data, and can be accessed by the host viaEvalContext::tag,EvalContext::tag_mut,NativeCallContext::tagandGlobalRuntimeState.tag.
Enhancements
- Improper
switchcase condition syntax is now caught at parse time. Engine::parse_jsonnow natively handles nested JSON inputs (using a token remap filter) without needing to replace{with#{.to_jsonis added to object maps to cheaply convert it to JSON format (()is mapped tonull, all other data types must be supported by JSON)FileModuleResolvernow accepts a customScopeto provide constants for optimization.- New variants,
StartandEnd, are added toDebuggerEventtriggered at the start/end of script evaluation.