v1.14.0
This new version contains a substantial number of bug fixes for edge cases.
A new syntax is supported to facilitate writing object methods in script.
The code hacks that attempt to optimize branch prediction performance are removed because benchmarks do not show any material speed improvements.
Bug fixes
is_shared
is a reserved keyword and is now handled properly (e.g. it cannot be the target of a function pointer).- Re-optimizing an AST via
optimize_ast
with constants now works correctly for closures. Previously the hiddenShare
nodes are not removed and causes variable-not-found errors during runtime if the constants are not available in the scope. - Expressions such as
(v[0].func()).prop
now parse correctly. - Shadowed variable exports are now handled correctly.
- Shadowed constant definitions are now optimized correctly when propagated (e.g.
const X = 1; const X = 1 + 1 + 1; X
now evaluates to 3 instead of 0). - Identifiers and comma's in the middle of custom syntax now register correctly.
- Exporting an object map from a module with closures defined on properties now works correctly when those properties are called to mimic method calls in OOP-style.
- Compiling for
thumbv6m-none-eabi
target (e.g. Raspberry Pi Pico) now completes successfully. Dependency tono-std-compat
is now pointed to the latest repo instead ofcrates.io
.
New features
- It is now possible to require a specific type to the
this
pointer for a particular script-defined function so that it is called only when thethis
pointer contains the specified type. is_def_fn
is extended to support checking for typed methods, with syntaxis_def_fn(this_type, fn_name, arity)
Dynamic::take
is added as a short-cut forstd::mem::take(&mut value)
.
Enhancements
Engine::is_symbol_disabled
is added to test whether a particular keyword/symbol is disabled.- Support is added to deserialize a
Dynamic
value containing custom types or shared values back into anotherDynamic
(essentially a straight cloned copy).