Fix string <.

This commit is contained in:
beard%netscape.com 2000-06-28 16:38:20 +00:00
parent d9bf640477
commit 941b505765
2 changed files with 2 additions and 2 deletions

View File

@ -234,7 +234,7 @@ static JSValue less_Default(const JSValue& r1, const JSValue& r2)
JSValue rv = r2.toPrimitive(JSValue::Number);
if (lv.isString() && rv.isString()) {
// XXX FIXME urgh, call w_strcmp ??? on a JSString ???
return JSValue(rv.string->compare(*lv.string));
return JSValue(double(lv.string->compare(*rv.string) < 0));
}
else {
lv = lv.toNumber();

View File

@ -234,7 +234,7 @@ static JSValue less_Default(const JSValue& r1, const JSValue& r2)
JSValue rv = r2.toPrimitive(JSValue::Number);
if (lv.isString() && rv.isString()) {
// XXX FIXME urgh, call w_strcmp ??? on a JSString ???
return JSValue(rv.string->compare(*lv.string));
return JSValue(double(lv.string->compare(*rv.string) < 0));
}
else {
lv = lv.toNumber();