diff --git a/js/js2/interpreter.cpp b/js/js2/interpreter.cpp index a226554f1d5..83a4baebd6a 100644 --- a/js/js2/interpreter.cpp +++ b/js/js2/interpreter.cpp @@ -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(); diff --git a/js2/src/interpreter.cpp b/js2/src/interpreter.cpp index a226554f1d5..83a4baebd6a 100644 --- a/js2/src/interpreter.cpp +++ b/js2/src/interpreter.cpp @@ -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();