I believe it is better to replace the current API call by
mw.user.tokens.get('editToken')
on
https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/mediawiki.api/mediawiki.api.edit.js?view=markup
and add "mediawiki.user" as a dependency on
https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/Resources.php?revision=112348&view=markup#l520
Version: 1.19.0
Severity: enhancement