another test for Function.prototype.apply handling

This commit is contained in:
Manu Sridharan 2013-06-03 14:03:28 -07:00
parent 26896049a7
commit 98e83e5103
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,5 @@
function foo() { alert("hello"); }
var y = Function.prototype.apply;
y.apply(foo);

View File

@ -380,7 +380,17 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
CallGraph CG = JSCallGraphBuilderUtil.makeScriptCG("tests", "function_apply2.js");
verifyGraphAssertions(CG, assertionsForFunctionApply2);
}
private static final Object[][] assertionsForFunctionApply3 = new Object[][] {
new Object[] { ROOT, new String[] { "tests/function_apply3.js" } },
new Object[] { "suffix:apply", new String[] { "suffix:foo" } } };
@Test
public void testFunctionDotApply3() throws IOException, IllegalArgumentException, CancelException, WalaException {
CallGraph CG = JSCallGraphBuilderUtil.makeScriptCG("tests", "function_apply3.js");
verifyGraphAssertions(CG, assertionsForFunctionApply3);
}
private static final Object[][] assertionsForWrap1 = new Object[][] {
new Object[] { ROOT, new String[] { "tests/wrap1.js" } },
new Object[] { "suffix:wrap1.js", new String[] { "suffix:i_am_reachable" } } };