leopard-js / leopard

Library for making Scratch-like projects with JavaScript.
https://leopardjs.com
MIT License
136 stars 26 forks source link

Compat support functions: toBoolean, compare #157

Closed towerofnix closed 1 year ago

towerofnix commented 1 year ago

Supporting PR for leopard-js/sb-edit#90. Adds toBoolean and compare functions, based on the corresponding implementations in scratch-vm's Cast utilities.

PullJosh commented 1 year ago

Looks nice! 👍

For others' reference, this code is equivalent to @apple502j's fast implementations of scratch-vm's Cast.toBoolean() and Cast.compare().