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
Loading...
Thumbnail Image
Name

splashwavefront2011-js-anonym.pdf

Type

Publisher's Version

Version

Published version

Access type

openaccess

Size

270.4 KB

Format

Adobe PDF

Checksum (MD5)

174961b0a14c136e34d023976468e255

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