compiler: improving JS validate