Talk:Tech/News/2023/48

Latest comment: 1 year ago by Tacsipacsi in topic Browsers not supporting async/await

Reiniciar

edit

Reiniciar equipo sin cuentas— The preceding unsigned comment was added by Luisalberto5432 (talk) 22:46, 19 November 2023 (UTC)Reply

@Luisalberto5432: The page mw:Help:Reset_password/es may help. Quiddity (WMF) (talk) 00:08, 21 November 2023 (UTC)Reply

Browsers not supporting async/await

edit

@Jdforrester (WMF): Which are the browsers that don’t support async/await? Looking at the browser compatibility table for async, browser compatibility table for await and our startup script, I couldn’t find any versions of supported browsers that would load JavaScript but not support async/await. —Tacsipacsi (talk) 19:19, 24 November 2023 (UTC)Reply

@Tacsipacsi: It's likely that there are some that have managed to pass until now but will have oddities like this. That's what we've found each time a new JS support item was added in the past. Jdforrester (WMF) (talk) 14:12, 27 November 2023 (UTC)Reply
@Jdforrester (WMF): But those aren’t supported browsers, are they? Also, the “be used appropriately” isn’t clear: either I use it or I don’t. If I use it, I’ll cause syntax error in those browsers, making the gadget totally unusable. If I don’t use it, then I don’t use it, so I didn’t win anything. —Tacsipacsi (talk) 14:28, 28 November 2023 (UTC)Reply
Indeed, so if you're going to use it in a gadget or a script you expect others to use, you should probably be aware of the risks of it breaking for some users, and potentially wrap things in an outer try/catch wrapper gadget that handles the failure, or wait a few months for MediaWiki to raise its requirement so that you can depend on it working safely. Jdforrester (WMF) (talk) 14:33, 28 November 2023 (UTC)Reply
A try/catch won’t help: using async or await in a browser that doesn’t support it is a syntax error, while try/catch handles semantic errors. In case of a syntax error, the control never reaches the try keyword. So the only possibility that left is not using this feature. It’s okay (we’ve been stuck with ES5 for quite some time now, a few more months doesn’t really matter), but “here is a new feature, but you shouldn’t use it for now” is probably not worth a Tech News entry. 😉 —Tacsipacsi (talk) 13:50, 29 November 2023 (UTC)Reply
Return to "Tech/News/2023/48" page.