Function calling begun.
git-svn-id: svn://10.0.0.236/trunk@34703 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
40
mozilla/js/js2/java/JSValueList.java
Normal file
40
mozilla/js/js2/java/JSValueList.java
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
class JSValueList extends JSValue {
|
||||
|
||||
static JSValueList buildList(JSValue left, JSValue right)
|
||||
{
|
||||
JSValueList theList;
|
||||
if (left instanceof JSValueList) {
|
||||
theList = (JSValueList)left;
|
||||
theList.add(right);
|
||||
}
|
||||
else
|
||||
if (right instanceof JSValueList) {
|
||||
theList = (JSValueList)right;
|
||||
theList.add(left);
|
||||
}
|
||||
else {
|
||||
theList = new JSValueList();
|
||||
theList.add(left);
|
||||
theList.add(right);
|
||||
}
|
||||
|
||||
return theList;
|
||||
}
|
||||
|
||||
void add(JSValue v)
|
||||
{
|
||||
if (v instanceof JSValueList) {
|
||||
JSValueList vl = (JSValueList)v;
|
||||
for (int i = 0; i < vl.contents.size(); i++)
|
||||
contents.addElement((JSValue)(vl.contents.elementAt(i)));
|
||||
}
|
||||
else
|
||||
contents.addElement(v);
|
||||
}
|
||||
|
||||
Vector contents = new Vector();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user