The default bug view has changed. See this FAQ.

Web Console setTimeout can't find declared functions by name

RESOLVED FIXED in Firefox 23

Status

()

Firefox
Developer Tools: Console
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: Michael A. Smith, Unassigned)

Tracking

Trunk
Firefox 23
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20100101 Firefox/13.0.1
Build ID: 20120614114901

Steps to reproduce:

In Firefox's Web Console I declared a function and then tried to call it in multiple ways:
function foo() { console.log("test"); }

--
[13:47:37.139] function foo() { console.log("test"); }

[13:47:37.142] undefined
[13:47:39.786] foo()
[13:47:39.788] test @ Web Console:1
[13:47:39.791] undefined
--
[13:47:45.282] eval("foo()")
[13:47:45.284] test @ Web Console:1
[13:47:45.287] undefined
--
[13:47:51.746] setTimeout(foo,0)
[13:47:51.748] 5
[13:47:51.752] test @ Web Console:1
--
[13:47:58.226] setTimeout("foo()",0)
[13:47:58.228] 6
[13:47:58.232] foo is not defined @ Web Console:1


Actual results:

When called with a string first argument (eval syntax), the function was not defined by name in the context of setTimeout.


Expected results:

eval syntax for setTimeout should behave the same as eval itself.
Component: Untriaged → Developer Tools: Console
Thank you for the bug report. This will be fixed by bug 783499.
Status: UNCONFIRMED → NEW
Depends on: 783499
Ever confirmed: true
OS: Mac OS X → All
Hardware: x86 → All
Version: 13 Branch → Trunk
Bug 783499 landed. This is now fixed.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
You need to log in before you can comment on or make changes to this bug.