Changeset 36727 in webkit for trunk/JavaScriptCore/kjs/operations.h
- Timestamp:
- Sep 20, 2008, 10:54:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/operations.h
r36483 r36727 31 31 bool strictEqual(JSValue*, JSValue*); 32 32 bool strictEqualSlowCase(JSValue*, JSValue*); 33 34 inline bool strictEqualSlowCaseInline(JSValue* v1, JSValue* v2) 35 { 36 ASSERT(!JSImmediate::areBothImmediate(v1, v2)); 37 38 if (JSImmediate::isEitherImmediate(v1, v2)) { 39 ASSERT(v1 == JSImmediate::zeroImmediate() || v2 == JSImmediate::zeroImmediate()); 40 ASSERT(v1 != v2); 41 42 // The reason we can't just return false here is that 0 === -0, 43 // and while the former is an immediate number, the latter is not. 44 if (v1 == JSImmediate::zeroImmediate()) 45 return static_cast<JSCell*>(v2)->isNumber() && static_cast<JSNumberCell*>(v2)->value() == 0; 46 return static_cast<JSCell*>(v1)->isNumber() && static_cast<JSNumberCell*>(v1)->value() == 0; 47 } 48 49 if (static_cast<JSCell*>(v1)->isNumber()) { 50 return static_cast<JSCell*>(v2)->isNumber() 51 && static_cast<JSNumberCell*>(v1)->value() == static_cast<JSNumberCell*>(v2)->value(); 52 } 53 54 if (static_cast<JSCell*>(v1)->isString()) { 55 return static_cast<JSCell*>(v2)->isString() 56 && static_cast<JSString*>(v1)->value() == static_cast<JSString*>(v2)->value(); 57 } 58 59 return v1 == v2; 60 } 61 33 62 JSValue* throwOutOfMemoryError(ExecState*); 34 63 }
Note:
See TracChangeset
for help on using the changeset viewer.