[webkit-changes] cvs commit: JavaScriptCore/kjs object.h operations.cpp

Anders andersca at opensource.apple.com
Sat Jan 7 02:32:26 PST 2006


andersca    06/01/07 02:32:25

  Modified:    .        ChangeLog
               kjs      object.h operations.cpp
  Log:
  2006-01-07  Anders Carlsson  <andersca at mac.com>
  
          Reviewed by Maciej.
  
          - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
          REGRESSION: JavaScript hang when comparing large array to null
  
          * kjs/object.h:
          (KJS::JSObject::isEqualToNull):
          Add new function which returns true if an object should be treated as null when
          doing comparisons.
  
          * kjs/operations.cpp:
          (KJS::equal):
          Use isEqualToNull.
  
  Revision  Changes    Path
  1.951     +19 -3     JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.950
  retrieving revision 1.951
  diff -u -r1.950 -r1.951
  --- ChangeLog	7 Jan 2006 10:22:44 -0000	1.950
  +++ ChangeLog	7 Jan 2006 10:32:23 -0000	1.951
  @@ -1,9 +1,25 @@
  +2006-01-07  Anders Carlsson  <andersca at mac.com>
  +
  +        Reviewed by Maciej.
  +        
  +        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
  +        REGRESSION: JavaScript hang when comparing large array to null
  +        
  +        * kjs/object.h:
  +        (KJS::JSObject::isEqualToNull):
  +        Add new function which returns true if an object should be treated as null when
  +        doing comparisons.
  +        
  +        * kjs/operations.cpp:
  +        (KJS::equal):
  +        Use isEqualToNull.
  +
   2006-01-07  Alexey Proskuryakov  <ap at nypop.com>
   
           Reviewed by Maciej.
   
  -	- Fix WebCore development build
  -	http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
  +	    - Fix WebCore development build
  +	    http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
   
           * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
   
  @@ -16,7 +32,7 @@
   	
           Changes mostly thanks to Maks Orlovich, tweaked a little by me.
   
  -        * kjs/create_hash_table: Use the same hash as the one used buy Identifier.
  +        * kjs/create_hash_table: Use the same hash as the one used by Identifier.
           * kjs/function.cpp:
           (KJS::FunctionImp::processParameters): Use the new List::copyFrom
           (KJS::ActivationImp::ActivationImp): track variable while iterating
  
  
  
  1.53      +4 -1      JavaScriptCore/kjs/object.h
  
  Index: object.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/object.h,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- object.h	27 Dec 2005 09:24:13 -0000	1.52
  +++ object.h	7 Jan 2006 10:32:25 -0000	1.53
  @@ -491,9 +491,12 @@
       double toNumber(ExecState *exec) const;
       UString toString(ExecState *exec) const;
       JSObject *toObject(ExecState *exec) const;
  -
  +    
       bool getPropertyAttributes(const Identifier& propertyName, int& attributes) const;
       
  +    // Returns whether the object should be treated as null when doing equality comparisons
  +    virtual bool isEqualToNull(ExecState *) const { return false; }
  +    
       // This get function only looks at the property map.
       // This is used e.g. by lookupOrCreateFunction (to cache a function, we don't want
       // to look up in the prototype, it might already exist there)
  
  
  
  1.16      +4 -4      JavaScriptCore/kjs/operations.cpp
  
  Index: operations.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/operations.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- operations.cpp	29 Dec 2005 08:18:40 -0000	1.15
  +++ operations.cpp	7 Jan 2006 10:32:25 -0000	1.16
  @@ -129,12 +129,12 @@
           } else {
               if ((t1 == StringType || t1 == NumberType) && t2 >= ObjectType)
                   return equal(exec, v1, v2->toPrimitive(exec));
  -            if (t1 == NullType && t2 >= ObjectType)
  -                return equal(exec, v1, v2->toPrimitive(exec, NullType));
  +            if (t1 == NullType && t2 == ObjectType)
  +                return static_cast<JSObject *>(v2)->isEqualToNull(exec);
               if (t1 >= ObjectType && (t2 == StringType || t2 == NumberType))
                   return equal(exec, v1->toPrimitive(exec), v2);
  -            if (t1 >= ObjectType && t2 == NullType)
  -                return equal(exec, v1->toPrimitive(exec, NullType), v2);
  +            if (t1 == ObjectType && t2 == NullType)
  +                return static_cast<JSObject *>(v1)->isEqualToNull(exec);
               if (t1 != t2)
                   return false;
           }
  
  
  



More information about the webkit-changes mailing list