Page MenuHomePhabricator

this.params is undefined
Closed, ResolvedPublic


Steps to reproduce:

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:;a=blob;f=modules/ext.apiSandbox.js;h=7f2aca2f4c705f81a7d1d8949a17cdb60a920152;hb=HEAD#l482

And finds some defined but never used variables.

Version: unspecified
Severity: normal



Event Timeline

Looks like Siebrand had started fixing some JSHint errors before: Gerrit change 39006

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][] ) {


if ( !hasOwnProperty( paramInfo[prop][] ) ) {

Fomafix, do you have a gerrit account? You could submit the patch yourself. [See]

Submitted fixed patch as I56e1637d.

[restoring priority setting which got deleted in comment 7.]

  • Bug 41828 has been marked as a duplicate of this bug. ***