HomePhorge

mediawiki.api: use `=== undefined` instead of typeof for local vars

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

mediawiki.api: use === undefined instead of typeof for local vars

Follows-up 7ce421f9bf.

typeof is analogous to isset() in PHP and tolerates non-existence,
and thus masks errors. The only reason to use typeof, is when
conditionally checking for the existence of a global variable, so
as to avoid a uncaught ReferenceError.

When referring to local vars or params, only its value needs to be
compared.

Ref https://www.mediawiki.org/wiki/CC/JS#Equality.

Bug: T359216
Change-Id: I509134993a41bb1bbcf829af8b56d72c85e10a92

Details

Provenance
Timo TijhofAuthored on Mar 30 2024, 12:36 AM

Event Timeline

Timo Tijhof <krinkle@fastmail.com> committed rMW4ce7d104c264: mediawiki.api: use `=== undefined` instead of typeof for local vars (authored by Timo Tijhof <krinkle@fastmail.com>).Mar 30 2024, 12:38 AM

Commit No Longer Exists

This commit no longer exists in the repository.