JavaScript debug helper functions