add a test
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4211 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
fbfdb32b11
commit
c316309900
|
@ -0,0 +1,35 @@
|
|||
function(date, interval, value) {
|
||||
var d = Ext.Date.clone(date),
|
||||
Date = Ext.Date;
|
||||
if (!interval || value === 0) return d;
|
||||
|
||||
switch(interval.toLowerCase()) {
|
||||
case Ext.Date.MILLI:
|
||||
d.setMilliseconds(d.getMilliseconds() + value);
|
||||
break;
|
||||
case Ext.Date.SECOND:
|
||||
d.setSeconds(d.getSeconds() + value);
|
||||
break;
|
||||
case Ext.Date.MINUTE:
|
||||
d.setMinutes(d.getMinutes() + value);
|
||||
break;
|
||||
case Ext.Date.HOUR:
|
||||
d.setHours(d.getHours() + value);
|
||||
break;
|
||||
case Ext.Date.DAY:
|
||||
d.setDate(d.getDate() + value);
|
||||
break;
|
||||
case Ext.Date.MONTH:
|
||||
var day = date.getDate();
|
||||
if (day > 28) {
|
||||
day = Math.min(day, Ext.Date.getLastDateOfMonth(Ext.Date.add(Ext.Date.getFirstDateOfMonth(date), 'mo', value)).getDate());
|
||||
}
|
||||
d.setDate(day);
|
||||
d.setMonth(date.getMonth() + value);
|
||||
break;
|
||||
case Ext.Date.YEAR:
|
||||
d.setFullYear(date.getFullYear() + value);
|
||||
break;
|
||||
}
|
||||
return d;
|
||||
}
|
|
@ -11,7 +11,6 @@ import com.ibm.wala.cast.js.ipa.callgraph.ForInContextSelector;
|
|||
import com.ibm.wala.cast.js.ipa.callgraph.JSCFABuilder;
|
||||
import com.ibm.wala.ipa.callgraph.CallGraph;
|
||||
import com.ibm.wala.ipa.callgraph.ContextSelector;
|
||||
import com.ibm.wala.ipa.callgraph.impl.DelegatingContextSelector;
|
||||
import com.ibm.wala.util.CancelException;
|
||||
|
||||
public class TestForInLoopHack extends TestJSCallGraphShape {
|
||||
|
|
|
@ -282,6 +282,11 @@ public abstract class TestSimpleCallGraphShape extends TestJSCallGraphShape {
|
|||
// all we need is for it to finish building CG successfully.
|
||||
}
|
||||
|
||||
@Test public void textExtJSSwitch() throws IOException, IllegalArgumentException, CancelException {
|
||||
Util.makeScriptCG("tests", "extjs_switch.js");
|
||||
// all we need is for it to finish building CG successfully.
|
||||
}
|
||||
|
||||
protected IVector<Set<Pair<CGNode, Integer>>> computeIkIdToVns(PointerAnalysis pa) {
|
||||
|
||||
// Created by reversing the points to mapping for local pointer keys.
|
||||
|
|
Loading…
Reference in New Issue