DocumentCode :
3696670
Title :
Detecting function purity in JavaScript
Author :
Jens Nicolay;Carlos Noguera;Coen De Roover;Wolfgang De Meuter
Author_Institution :
Software Languages Lab, Vrije Universiteit Brussel, Brussels, Belgium
fYear :
2015
Firstpage :
101
Lastpage :
110
Abstract :
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.
Keywords :
"Reactive power","Semantics","Resource management","Context","Arrays","Standards","Benchmark testing"
Publisher :
ieee
Conference_Titel :
Source Code Analysis and Manipulation (SCAM), 2015 IEEE 15th International Working Conference on
Type :
conf
DOI :
10.1109/SCAM.2015.7335406
Filename :
7335406
Link To Document :
بازگشت