Console adds </< after the name of a function

RESOLVED INVALID

Status

()

Firefox
Developer Tools: Console
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: Oriol, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:42.0) Gecko/20100101 Firefox/42.0
Build ID: 20150703030216

Steps to reproduce:

Run this in the console
> var f = new function(){ return function (){} }; f;


Actual results:

The console shows
> function f</<()


Expected results:

It should show
> function f()
(Reporter)

Updated

3 years ago
Component: Untriaged → Developer Tools: Console
Version: 42 Branch → unspecified
This may be slightly counterintuitive in this particular case, but it is working as intended, per the static inference implemented in bug 433529. The resulting function f has the name "f</<" to indicate that it is an anonymous function declared inside another anonymous function assigned to variable f. See this slide for more examples or read the bug above for a reference to the paper that introduced this pattern:

http://astithas.com/talks/qconsf2013/#/18/2
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.