Closed Bug 774365 Opened 12 years ago Closed 12 years ago

Web Console setTimeout can't find declared functions by name

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 23

People

(Reporter: michael, Unassigned)

References

Details

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
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 23
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.