Mozilla/mozilla/js/js2/java/JSBoolean.java
rogerl%netscape.com 095914ec44 Switching to JSValue throughout. Implementing operators per base type.
git-svn-id: svn://10.0.0.236/trunk@32415 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-20 21:16:11 +00:00

33 lines
514 B
Java

class JSBoolean extends JSValue {
static JSBoolean JSTrue = new JSBoolean(true);
static JSBoolean JSFalse = new JSBoolean(false);
private JSBoolean(boolean p)
{
b = p;
}
void eval(Environment theEnv)
{
theEnv.theStack.push(this);
}
boolean isTrue()
{
return b;
}
boolean isFalse()
{
return !b;
}
JSBoolean toJSBoolean() {
return this;
}
boolean b;
}