Add array API with closure variation that binds to this.

This commit is contained in:
Stephen Chung
2022-12-24 19:37:06 +08:00
parent ffa1f5fb4a
commit fd401f3048
6 changed files with 162 additions and 70 deletions

View File

@@ -55,6 +55,11 @@ Net features
* A compact script compresses better than one with liberal whitespaces and comments.
* Unlike some uglifiers or minifiers, `Engine::compact_script` does not optimize the script in any way, nor does it rename variables.
### Enhanced array API
* Array methods that take a function pointer, usually a closure (e.g. `map`, `filter`, `index_of` etc.), can now provide a closure with one few parameter but binds the first parameter to `this`.
* This vastly improves performance when working with arrays of object maps by avoiding unnecessary cloning of large types.
Enhancements
------------