Closed Bug 536085 Opened 16 years ago Closed 15 years ago

Function.prototype.toString strips out some string literals

Categories

(Firefox :: General, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: juliant, Unassigned)

Details

(Whiteboard: [CLOSEME 2011-1-30])

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) If I have a function:- function f() { "some string"; } toString returns "function f(){}" All other browsers include "some string;". I am trying to use this statement to provide some configuration, a bit like the proposed "use strict"; I appreciate that this may not be seen as a bug, as the ECMAScript specification does not determine what "toString()" should produce for a Function, but it would be nice if browsers could be consistent with this. Reproducible: Always Steps to Reproduce: (function f(){"some string";}).toString() Actual Results: function f(){} Expected Results: function f(){"some string";}
Strangely:- function f() { {namespace : "string"}; } produces function f() { namespace : "string"; } which in some way is a workaround, as effectively it is turned into a label?
Reporter, are you still seeing this issue with Firefox 3.6.13 or later in safe mode? If not, please close. These links can help you in your testing. http://support.mozilla.com/kb/Safe+Mode http://support.mozilla.com/kb/Managing+profiles You can also try to reproduce in Firefox 4 Beta 8 or later, there are many improvements in the new version, http://www.mozilla.com/en-US/firefox/all-beta.html
Whiteboard: [CLOSEME 2011-1-30]
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
This is still incorrect in FF 7
Behaviour remains same in FF12 and FF13b7
You need to log in before you can comment on or make changes to this bug.