fix test case for Function.call(), add test case for Function.apply()

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4309 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
msridhar1 2012-01-06 21:19:36 +00:00
parent ef41232ece
commit 74911f269e
3 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,5 @@
function bar(y) { return y + 3; }
var p = bar;
p.apply(null, [7]);

View File

@ -1 +1,5 @@
(function foo(x) { return x; }).call(null, 3);
function foo(x) { return x; }
var z = foo;
z.call(null, 3);

View File

@ -292,6 +292,12 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
// TODO assert that foo() is reachable
}
@Test public void testFunctionDotApply() throws IOException, IllegalArgumentException, CancelException {
Util.makeScriptCG("tests", "function_apply.js");
// TODO assert that bar() is reachable
}
protected IVector<Set<Pair<CGNode, Integer>>> computeIkIdToVns(PointerAnalysis pa) {
// Created by reversing the points to mapping for local pointer keys.