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_sharedis 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_astwith constants now works correctly for closures. Previously the hiddenSharenodes 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()).propnow 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; Xnow 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-eabitarget (e.g. Raspberry Pi Pico) now completes successfully. Dependency tono-std-compatis now pointed to the latest repo instead ofcrates.io.
New features
- It is now possible to require a specific type to the
thispointer for a particular script-defined function so that it is called only when thethispointer contains the specified type. is_def_fnis extended to support checking for typed methods, with syntaxis_def_fn(this_type, fn_name, arity)Dynamic::takeis added as a short-cut forstd::mem::take(&mut value).
Enhancements
Engine::is_symbol_disabledis added to test whether a particular keyword/symbol is disabled.- Support is added to deserialize a
Dynamicvalue containing custom types or shared values back into anotherDynamic(essentially a straight cloned copy).