espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.77k stars 745 forks source link

Implement `Object.fromEntries` #2327

Closed Dabolus closed 1 year ago

Dabolus commented 1 year ago

This PR adds support for Object.fromEntries from ES2019.

Opening as a draft because I still have to figure out how to properly run tests.

gfwilliams commented 1 year ago

Thanks - I think running tests is as easy as building for Linux and running ./espruino --test ...

But this code may be broken - I think jsvObjectSetChildAndUnLock expects a string as a second argument and also key would need to be unlocked anyway in the jsvObjectSetChildAndUnLock case.

gfwilliams commented 1 year ago

Had to do a few fixes for this, but it's added now

Dabolus commented 1 year ago

Thank you! 🥳