Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Conferences, Workshops, Symposiums, and Seminars
  4. Naming Anonymous JavaScript Functions
 
conference paper

Naming Anonymous JavaScript Functions

Mirghasemi, Salman  
•
Barton, John J.
•
Petitpierre, Claude  
2011
OOPSLA '11: Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion
SPLASH

JavaScript developers create programs by calling functions and they use functions to construct objects. JavaScript development tools need to report to developers about those functions and constructors, for example in debugger call-stacks and in object representations. However, most functions are anonymous: developers need not to specify names for functions. Based on our analysis of ten large, widely used JavaScript projects, less than 7% of JavaScript functions are named by developers. After studying examples from these JavaScript projects, we propose \textit{Static Function-Object Consumption}, a principled, automated approach based on local source code analysis for providing names to nameless JavaScript functions. We applied our approach to 90000 anonymous functions that appeared in the analyzed JavaScript project. The approach is successful in naming more than 99% (91% are unique within their file) of anonymous functions while the average length of function names is kept less than 37 characters.

  • Files
  • Details
  • Metrics
Type
conference paper
DOI
10.1145/2048147.2048222
Author(s)
Mirghasemi, Salman  
Barton, John J.
Petitpierre, Claude  
Date Issued

2011

Published in
OOPSLA '11: Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion
Start page

277

End page

288

Subjects

JavaScript

•

Anonymous Function Name

•

Debugger

Editorial or Peer reviewed

REVIEWED

Written at

EPFL

EPFL units
LTI  
Event nameEvent placeEvent date
SPLASH

Portland, Oregon

October 22-27

Available on Infoscience
September 14, 2011
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/70954
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés