Ignore:
Timestamp:
May 21, 2008, 6:20:45 PM (17 years ago)
Author:
[email protected]
Message:

Merge squirrelfish branch into trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/operations.cpp

    r29045 r33979  
    9999}
    100100
    101 bool strictEqual(ExecState *exec, JSValue *v1, JSValue *v2)
     101bool strictEqual(JSValue* v1, JSValue* v2)
    102102{
    103103    JSType t1 = v1->type();
     
    106106    if (t1 != t2)
    107107        return false;
    108     if (t1 == UndefinedType || t1 == NullType)
    109         return true;
    110     if (t1 == NumberType) {
    111         double n1 = v1->toNumber(exec);
    112         double n2 = v2->toNumber(exec);
    113         if (n1 == n2)
    114             return true;
    115         return false;
    116     } else if (t1 == StringType)
    117         return v1->toString(exec) == v2->toString(exec);
    118     else if (t2 == BooleanType)
    119         return v1->toBoolean(exec) == v2->toBoolean(exec);
     108
     109    if (t1 == NumberType)
     110        return v1->getNumber() == v2->getNumber();
    120111   
    121     if (v1 == v2)
    122         return true;
    123     /* TODO: joined objects */
     112    if (t1 == StringType)
     113        return static_cast<StringImp*>(v1)->value() == static_cast<StringImp*>(v2)->value();
    124114   
    125     return false;
     115    return v1 == v2; // covers object, boolean, null, and undefined types
     116}
     117
     118JSValue* throwOutOfMemoryError(ExecState* exec)
     119{
     120    JSObject* error = Error::create(exec, GeneralError, "Out of memory");
     121    exec->setException(error);
     122    return error;
    126123}
    127124
Note: See TracChangeset for help on using the changeset viewer.