nit: `},function onerror() {` => `}, function onerror() {`