Page MenuHomePhabricator

Flow should mw.Map#get() instead of deprecated "Map-values"
Closed, ResolvedPublic

Description

The following warning started to appear in the console for all Flow pages:

Use of "Map-values" is deprecated. mw.Map#values is deprecated. Use mw.Map#get() instead.

E.g. at https://www.mediawiki.org/wiki/Topic:Te7j4ti0qp55osh8 and https://pt.wikibooks.org/wiki/Wikilivros_Discuss%C3%A3o:Portal_comunit%C3%A1rio

See also

Event Timeline

He7d3r created this task.Oct 27 2016, 12:43 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
He7d3r updated the task description. (Show Details)
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptOct 28 2016, 10:24 PM

I can help with that. Is the function mw.Map#values in many files or the one you pointed only ?

Thanks, I have already made the commit but jenkins is complaining for a non existing test error

I made a gerrit review but jenkins is complaining about a non existent problem in a different file from those I edited

https://gerrit.wikimedia.org/r/#/c/318793

I search around the web and I found out that jhint expect all the functions that start with an uppercase to be object constructors and it displays an error that the function is not initialized with the 'new' keyword
for more information

http://stackoverflow.com/questions/10668111/jshint-expects-the-new-prefix-for-functions

https://integration.wikimedia.org/ci/job/jshint/6340/console linked from https://gerrit.wikimedia.org/r/#/c/318793 says:

modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js: line 203, col 48, Missing 'new' prefix when invoking a constructor.

That indeed is far away from code that you touched in your patch. :(

https://integration.wikimedia.org/ci/job/jshint/6340/console linked from https://gerrit.wikimedia.org/r/#/c/318793 says:

modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js: line 203, col 48, Missing 'new' prefix when invoking a constructor.

That indeed is far away from code that you touched in your patch. :(

I worked around this in a separate patch. I'll rebase your patch onto that.

Catrope closed this task as Resolved.Nov 8 2016, 6:46 PM
Catrope added a subscriber: Catrope.

https://gerrit.wikimedia.org/r/#/c/318793 was merged, but the Gerrit bot didn't post about it here because of an excess newline in the commit message :/