https://bugzilla.wikimedia.org/show_bug.cgi?id=68235

Roan Kattouw <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |FIXED

--- Comment #5 from Roan Kattouw <[email protected]> ---
This was caused by local JS overwriting Function.prototype.bind with a broken
polyfill that ignores additional parameters rather than passing them to the
bound function.

We were using something like onSave.bind( this, doc, saveData ) which should
have resulted in a call like onSave( doc, saveData, responseData, statusText,
jqXHR ) but the broken polyfill dropped doc and saveData, causing the remaining
arguments to be shifted two places to the left. Then when we check if
responseData.error is defined, we're really looking at jqXHR.error, which is in
fact a method on the jqXHR object, so it's always defined and we always believe
there is an error, even if there isn't one. But of course we can't find an
error code or error text because we're looking in the wrong place, so we say
"Unknown error". In fact, we would say that even if there was an error, because
the error data got shifted over into the doc parameter, which we don't look at.

https://office.wikimedia.org/w/index.php?title=MediaWiki:LAPI.js&diff=115901&oldid=24064
fixes the unconditional overwrite so Function.prototype.bind isn't overwritten
if it's already present. This check was already being done for everything else
that the script polyfills.

https://office.wikimedia.org/w/index.php?title=MediaWiki%3ALAPI.js&diff=115904&oldid=115902
fixes the polyfill to correctly pass additional parameters along.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to