Warnings from Firefox (Fehler-Konsole)

2 views
Skip to first unread message

mareb

unread,
Apr 15, 2009, 4:26:17 AM4/15/09
to Prototype & script.aculo.us
Hello
if I use prototype.js there are shown many warning with Firefox.
For example:
"function _uCInfo does not always return a value" (Line 266)

There are so much warnings, that it is hard to find the warnings of my
own code.
It should be easy to eliminate the warnings, but I don't like to
change prototype.js, because my changes are loosed with the next
update.

Why it is not done by the prototype team?

If I do change the code, can I send a patch to someone?

Thank you

T.J. Crowder

unread,
Apr 15, 2009, 5:29:38 AM4/15/09
to Prototype & script.aculo.us
Hi,

> "function _uCInfo does not always return a value" (Line 266)

Does Prototype have a _uCInfo function? I can't find it (1.6.0.3).
If not, can you give an example from one of Prototype's own functions?

I don't normally use the Firefox console, but I just ran a few simple
pages with it showing and didn't see any warnings like that.
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

mareb

unread,
Apr 15, 2009, 5:51:16 AM4/15/09
to Prototype & script.aculo.us
Hi,
I did grab the wrong line from error console. This line comes from
google code. A real line from prototype.js is:

"function stopObserving does not always return a value" (line 4593)

Marcus Schwarz

unread,
Apr 15, 2009, 5:34:44 AM4/15/09
to prototype-s...@googlegroups.com
Hi mareb,

> if I use prototype.js there are shown many warning with Firefox.
> For example:
> "function _uCInfo does not always return a value" (Line 266)

I think this is a problem with google analytics, not with prototype. If
you google for _uCInfo you find a lot of results about google analytics,
like the following, which exactly shows your error message:
http://groups.google.com/group/analytics-help-basics/browse_thread/thread/e316d1fd32ddf41c?pli=1


regards

Marcus

T.J. Crowder

unread,
Apr 15, 2009, 7:56:45 AM4/15/09
to Prototype & script.aculo.us
Hi,

What version are you using? In 1.6.0.3 (the latest non-beta copy),
stopObserving is lines 4022-4051, and there is no non-exception code
path that doesn't return a value.

Again, using Prototype, I don't see these errors from the Firefox
error console. Do you have some kind of lint plugin? I don't get
that warning if I try intentionally to create it, e.g.:

function sometimes(arg) {
if (arg > 4) {
return arg + 4;
}
}

(I should note that even though it's poor style, the above is
perfectly valid JavaScript. In the case of the above, if you call
sometimes(1), the value you'll get back is undefined (literally, the
undefined object), which is as per the spec. But I wouldn't be
surprised if a lint plug-in flagged that up as probably not being what
you meant to do.)
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


mareb

unread,
Apr 16, 2009, 12:23:41 AM4/16/09
to Prototype & script.aculo.us
Hello,

On 15 Apr., 13:56, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
> Hi,
>
> What version are you using?  In 1.6.0.3 (the latest non-beta copy),
> stopObserving is lines 4022-4051, and there is no non-exception code
> path that doesn't return a value.

Sorry, not to say it: my version is 1.6.1_rc2

>
> Again, using Prototype, I don't see these errors from the Firefox
> error console.  Do you have some kind of lint plugin?  I don't get

I have installed AddOns Firebug and Web-Developer. Using Firefox 3.0.7

Please have a look to the new version.

T.J. Crowder

unread,
Apr 16, 2009, 3:09:51 AM4/16/09
to Prototype & script.aculo.us
Hi,

Does it happen with 1.6.0.3?

-- T.J.

mareb

unread,
Apr 16, 2009, 6:16:24 AM4/16/09
to Prototype & script.aculo.us
I remember such warnings from previous version too.

I just test it with version 1.6.0.2 and get a lots of warnings too.

T.J. Crowder

unread,
Apr 16, 2009, 9:36:13 AM4/16/09
to Prototype & script.aculo.us
Hi,

> I remember such warnings from previous version too.
>
> I just test it with version 1.6.0.2 and get a lots of warnings too.

I don't get them at all with 1.6.0.3 using FF3 and the latest Firebug.

But regardless of the warnings, the 1.6.1 RC2 version of stopObserving
definitely has a regression on that line:

4593: if (!responders) return;

That should be:

4593: if (!responders) return element;

I'd suggest raising a ticket in Lighthouse[1] for this (after first
checking to make sure there isn't already one there), and for any
others you find where a function is returning something other than
what the docs say. Note (again) that it's perfectly valid to issue a
return statement without a value sometimes, if what you're returning
is meant to be undefined ("return;" and "return undefined;" are
exactly the same thing). But in this case, stopObserving is meant to
return the element.

[1] https://prototype.lighthouseapp.com/projects/8886-prototype
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

Reply all
Reply to author
Forward
0 new messages