We present an approach to detect function purity in JavaScript.
A function is pure if none of its applications cause observable side-effects.
The approach is based on a pushdown flow analysis that besides traditional control and value flow also keeps track of write effects.
To increase the precision of our purity analysis, we combine it with an intraprocedural analysis to determine freshness of variables and object references.
We formalize the core aspects of our analysis, and discuss our implementation used to analyze several common JavaScript benchmarks.
Experiments show that our technique is capable of detecting function purity, even in the presence of higher-order functions, dynamic property expressions, and prototypal inheritance.
Original languageEnglish
Title of host publicationProceedings of the 15th IEEE Working Conference on Source Code Analysis and Manipulation (SCAM)
Place of PublicationBremen, DE
PublisherIEEE
Pages101-110
Number of pages10
ISBN (Print)9781467375306
Publication statusPublished - Sep 2015
Event15th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM) - Bremen, Belgium
Duration: 27 Sep 201528 Sep 2015

Conference

Conference15th IEEE International Working Conference on Source Code Analysis and Manipulation (SCAM)
CountryBelgium
CityBremen
Period27/09/1528/09/15

    Research areas

  • static analysis, abstract interpretation, effects, JavaScript

ID: 11148968