WALA JavaScript: analyzing dependencies & classes

9 views
Skip to first unread message

GRAM STYPE

unread,
Apr 15, 2022, 10:01:44 AM4/15/22
to wala.sourceforge.net
Hello,

I am looking to use WALA for some JavaScript analysis. I have been able to use the WALA-start repo to get setup and run some of the built-in examples successfully, but I was confronted with errors when I tried running some other examples. It would be greatly helpful if you can help me out with the following questions, or point me in the right direction.

1. I am unable to run WALA with JS files containing "class" definitions (ES6). For example, see https://github.com/trekhleb/javascript-algorithms/blob/master/src/data-structures/disjoint-set/DisjointSetItem.js

If this is supported, is there an example driver that I can use as a template?

2. I am looking to use WALA to analyze multiple inter-dependent JS files at a time (e.g., a function is defined and "export"-ed in one source file, and "import"-ed and invoked in another source file, see example below). I have been unsuccessful trying to modify the com.ibm.wala.examples.drivers.JSCallGraphDriver for this purpose. I could not find any such example in the existing drivers. What is the correct way to set up WALA to analyze these?

Example:
=================
sub.js:
--------

function f(x) {
alert(Welcome ${x}!);
}
export {f};

main.js:
----------

import {f} from './sub.js';
f('John');

=================

I am using WALA with Java 11 on a Mac.

Thanks!

Reply all
Reply to author
Forward
0 new messages