Pathoschild / Wikimedia-contrib

A collection of user scripts and Tool Labs tools intended for users of Wikimedia Foundation wikis.
MIT License
45 stars 28 forks source link

JQMIGRATE warnings for $.isArray and $.isFunction #150

Closed inductiveload closed 3 years ago

inductiveload commented 3 years ago

On enwikisource, I'm seeing JQMIGRATE console warnings due to

https://github.com/Pathoschild/Wikimedia-contrib/blob/2284afdf5e3c91b67f7def7a57166a9514dbb2a5/user-scripts/pathoschild.templatescript.js#L964

(though that is not the only use of $.isArray)

JQMIGRATE: jQuery.isArray is deprecated; use Array.isArray

I think it's a simple change to Array.isArray( opts ) (and similar for the others).

Similarly: JQMIGRATE: jQuery.isFunction is deprecated from

https://github.com/Pathoschild/Wikimedia-contrib/blob/2284afdf5e3c91b67f7def7a57166a9514dbb2a5/user-scripts/pathoschild.templatescript.js#L804

which is the same as typeof opts.script === "function"

Pathoschild commented 3 years ago

Fixed; thanks for reporting it! (It may take a few hours for the server cache to update, in addition to your browser's cache time.)

he7d3r commented 3 years ago

@Pathoschild Should this issue be closed?

Pathoschild commented 3 years ago

Yep, I haven't seen any more reports about it.