[js] bugfix - do not dereference 'int val' objects for ref_count in env_dump()