Last modified: 2013-01-26 21:19:27 UTC
Steps to reproduce: * Open https://en.wikipedia.org/wiki/Special:ApiSandbox?debug=true * Select "Action" -> "watch" In the JavaScript Console occurs: TypeError: this.params is undefined for ( i = 0, length = this.params.length; i < length; i += 1 ) { ext.apiSandbox.js (line 483) In line 482 a semicolon is missing: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/ApiSandbox.git;a=blob;f=modules/ext.apiSandbox.js;h=7f2aca2f4c705f81a7d1d8949a17cdb60a920152;hb=HEAD#l482 And http://www.jshint.com/ finds some defined but never used variables.
Looks like Siebrand had started fixing some JSHint errors before: Gerrit change #39006
That was I978d37c0
Also I don't get this error. What web browser are you using?
(In reply to comment #3) > Also I don't get this error. What web browser are you using? I get the error in Firefox 18.0. In Chrome and Internet Explorer I don't get an error.
I can confirm getting this error in Firefox 17.0.1 on Fedora16.
Works correctly in Opera as well. This is because ApiSandbox uses 'watch' as a key in the object storing information about parameters taken by various APIs, and Firefox supports a watch() function on all object that can be used to register callback to be fired when a certain property of that object is changed. Other browsers apparently either don't support it, or allow is to be overridden; Firefox doesn't, and thus when `new UiBuilder( $mainContainer, info, '' );` is called on line 348, "info" is a reference to this watch() function instead of the object with data that the code expects. This will probably need to be special-cased somewhere.
Yes, thats the reason: var o = { 'name': 42 } o['name'] >> 42 o['noname'] >> undefined o['watch'] >> watch() o.hasOwnProperty( 'name' ) >> true o.hasOwnProperty( 'noname' ) >> false o.hasOwnProperty( 'watch' ) >> false The solution would be to replace in line 104 if ( !paramInfo[prop][info.name] ) { by if ( !hasOwnProperty( paramInfo[prop][info.name] ) ) {
Fomafix, do you have a gerrit account? You could submit the patch yourself. [See https://www.mediawiki.org/wiki/Developer_access]
Submitted fixed patch as I56e1637d.
[restoring priority setting which got deleted in comment 7.]
Merged.
*** Bug 41828 has been marked as a duplicate of this bug. ***