Copyright 2009-2015 Aarhus University
For research publications and other information about this tool see http://www.brics.dk/TAJS.
How to build and run the tool
The simplest way to build TAJS is to run
ant, which will build two jar files:
dist/tajs.jar (which contains only TAJS itself) and
dist/tajs-all.jar (which also includes the relevant extra libraries).
The jar files are also available for download at http://www.brics.dk/TAJS/dist/.
You can now run the analysis as, for example:
java -jar dist/tajs-all.jar test/google/richards.js
java -jar dist/tajs-all.jar test/chromeexperiments/3ddemo.html
By default, TAJS outputs some information about its progress and eventually a list of type warnings and other messages.
Some of the available options (run TAJS without arguments to see the full list):
-callgraph- output call graph as text and in a file
out/callgraph.dot(process with Graphviz dot)
-collect-variable-info- output type and line information about all variables
-debug- output extensive internal information during the analysis
-flowgraph- output the initial and final flow graphs (TAJS's intermediate representation) as text and to
out/flowgraphs/(in Graphviz dot format, with a file for each function and for the complete program)
-low-severity- enable many more type warnings
-quiet- only print results, not information about analysis progress
-states- output intermediate abstract states during the analysis
-uneval- enable the Unevalizer for on-the-fly translation of
Note that the analysis produces lots of addition information that is not output by default. If you want full access to the abstract states and call graphs, as a starting point see the source code for
The javadoc for TAJS is available at http://www.brics.dk/TAJS/doc/.
Special built-in functions
TAJS recognizes a few special built-in functions (defined as properties of the global object) to support debugging and testing of the tool, including:
TAJS_dumpValue(exp)- report the abstract value of expression
expafter analysis has completed
TAJS_dumpObject(obj)- report the properties of the abstract object
objafter analysis has completed
TAJS_dumpState()- report the abstract state at this program point after analysis has completed
TAJS_assert(value)- tests that
true, failure will result in an AssertionError.
TAJS_assert(value, predicate, expectedResult)- a generalized version of the single-argument TAJS_assert, supports disjunctions of the predicate methods in Value.java. E.g. to check that a value is either a single concrete string or some unsigned integer:
TAJS_assert(myValue, 'isMaybeSingleStr || isMaybeNumUInt', true)
Running regression tests
test contains a collection of tests that can be executed by running
dk.brics.tajs.test.RunRegression with JUnit from Eclipse or with
ant test from the command-line.
The following people have contributed to the source code:
- Anders Møller
- Simon Holm Jensen
- Peter Thiemann
- Magnus Madsen
- Matthias Diehn Ingesman
- Peter Jonsson
- Esben Andreasen
This software includes components from: