Function wrappers for JavaScript