Mozilla/mozilla/js/js2/java/JSBoolean.java
rogerl%netscape.com a58c620f15 New.
git-svn-id: svn://10.0.0.236/trunk@32351 18797224-902f-48f8-a5cc-f745e15eee43
1999-05-20 00:14:26 +00:00

21 lines
457 B
Java

class JSBoolean extends JSValue {
JSBoolean(String s)
{
if (s.equals("true"))
b = true;
else
if (s.equals("false"))
b = false;
else
throw new RuntimeException("Bad string for JSBoolean constructor : " + s);
}
void eval(Environment theEnv)
{
theEnv.theStack.push(new StackValue(b ? 1 : 0));
}
boolean b;
}