Naming anonymous javascript functions.

SPLASH '11: Conference on Systems, Programming, and Applications: Software for Humanity Portland Oregon USA October, 2011(2011)

引用 5|浏览24
暂无评分
摘要
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 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 projects. 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.
更多
查看译文
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要