Added test case for handling of arguments array.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4388 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
5f6fc74836
commit
13202e726e
|
@ -0,0 +1,15 @@
|
||||||
|
function f() {
|
||||||
|
arguments[0].g();
|
||||||
|
}
|
||||||
|
f.g = function g1() {};
|
||||||
|
|
||||||
|
var o = {
|
||||||
|
f: f,
|
||||||
|
g: function g2() { }
|
||||||
|
}
|
||||||
|
|
||||||
|
var oo = {
|
||||||
|
g: function g3() { }
|
||||||
|
}
|
||||||
|
|
||||||
|
o.f(oo);
|
|
@ -436,6 +436,18 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
|
||||||
verifyGraphAssertions(CG, assertionsForReturnThis2);
|
verifyGraphAssertions(CG, assertionsForReturnThis2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Object[][] assertionsForArguments = new Object[][] {
|
||||||
|
new Object[] { ROOT, new String[] { "tests/arguments.js" } },
|
||||||
|
new Object[] { "suffix:arguments.js", new String[] { "suffix:f" } },
|
||||||
|
new Object[] { "suffix:f", new String[] { "suffix:g3" } } // but neither "suffix:g1" nor "suffix:g2"
|
||||||
|
};
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testArguments() throws IOException, IllegalArgumentException, CancelException {
|
||||||
|
CallGraph CG = Util.makeScriptCG("tests", "arguments.js");
|
||||||
|
verifyGraphAssertions(CG, assertionsForArguments);
|
||||||
|
}
|
||||||
|
|
||||||
private static final Object[][] assertionsForFunctionIsAFunction = new Object[][] {
|
private static final Object[][] assertionsForFunctionIsAFunction = new Object[][] {
|
||||||
new Object[] { ROOT, new String[] { "tests/Function_is_a_function.js" } },
|
new Object[] { ROOT, new String[] { "tests/Function_is_a_function.js" } },
|
||||||
new Object[] { "suffix:Function_is_a_function.js", new String[] { "suffix:functionCall" } } };
|
new Object[] { "suffix:Function_is_a_function.js", new String[] { "suffix:functionCall" } } };
|
||||||
|
|
Loading…
Reference in New Issue