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

Geoffrey ggaren at opensource.apple.com
Thu Dec 29 03:38:58 PST 2005


ggaren      05/12/29 03:38:57

  Modified:    .        ChangeLog
               kjs      string_object.cpp string_object.h
  Log:
          Patch by Maks Orlovich, reviewed by mjs.
  
          This has 2 very minor fixes, covered by KJS testsuite:
          1. Enumerates string indices in property list (with the same bug as array
             object has in corresponding code). This is a mozilla emulation thing.
          2. Permits properties with integer names in prototypes to be found
  
          * kjs/string_object.cpp:
          (StringInstance::getOwnPropertySlot):
          (StringInstanceImp::propList):
          * kjs/string_object.h:
  
  Revision  Changes    Path
  1.940     +14 -0     JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.939
  retrieving revision 1.940
  diff -u -r1.939 -r1.940
  --- ChangeLog	29 Dec 2005 11:16:08 -0000	1.939
  +++ ChangeLog	29 Dec 2005 11:38:55 -0000	1.940
  @@ -1,3 +1,17 @@
  +2005-12-29  Geoffrey Garen  <ggaren at apple.com>
  +
  +        Patch by Maks Orlovich, reviewed by mjs.
  +
  +        This has 2 very minor fixes, covered by KJS testsuite:    
  +        1. Enumerates string indices in property list (with the same bug as array    
  +           object has in corresponding code). This is a mozilla emulation thing. 
  +        2. Permits properties with integer names in prototypes to be found    
  +
  +        * kjs/string_object.cpp:
  +        (StringInstance::getOwnPropertySlot):
  +        (StringInstanceImp::propList):
  +        * kjs/string_object.h:
  +
   2005-12-26  Geoffrey Garen  <ggaren at apple.com>
   
           Reviewed by mjs.
  
  
  
  1.55      +14 -2     JavaScriptCore/kjs/string_object.cpp
  
  Index: string_object.cpp
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/string_object.cpp,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- string_object.cpp	18 Dec 2005 03:09:31 -0000	1.54
  +++ string_object.cpp	29 Dec 2005 11:38:57 -0000	1.55
  @@ -28,6 +28,7 @@
   #include "types.h"
   #include "interpreter.h"
   #include "operations.h"
  +#include "reference_list.h"
   #include "regexp.h"
   #include "regexp_object.h"
   #include "error_object.h"
  @@ -75,11 +76,11 @@
     if (ok) {
       const UString s = internalValue()->toString(exec);
       const unsigned length = s.size();
  -    if (index >= length)
  -      return false;
  +    if (index < length) {
       slot.setCustomIndex(this, index, indexGetter);
       return true;
     }
  +  }
   
     return JSObject::getOwnPropertySlot(exec, propertyName, slot);
   }
  @@ -98,6 +99,17 @@
     return JSObject::deleteProperty(exec, propertyName);
   }
   
  +ReferenceList StringInstance::propList(ExecState *exec, bool recursive)
  +{
  +  ReferenceList properties = JSObject::propList(exec,recursive);
  +
  +  //### FIXME: should avoid duplicates with prototype
  +  UString str = internalValue()->toString(exec);
  +  for (int i = 0; i < str.size(); i++)
  +    properties.append(Reference(this, i));
  +  return properties;
  +}
  +
   // ------------------------------ StringPrototype ---------------------------
   const ClassInfo StringPrototype::info = {"String", &StringInstance::info, &stringTable, 0};
   /* Source for string_object.lut.h
  
  
  
  1.17      +1 -0      JavaScriptCore/kjs/string_object.h
  
  Index: string_object.h
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/kjs/string_object.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- string_object.h	13 Dec 2005 21:24:53 -0000	1.16
  +++ string_object.h	29 Dec 2005 11:38:57 -0000	1.17
  @@ -35,6 +35,7 @@
       virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
       virtual void put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr = None);
       virtual bool deleteProperty(ExecState *exec, const Identifier &propertyName);
  +    virtual ReferenceList propList(ExecState *exec, bool recursive);
   
       virtual const ClassInfo *classInfo() const { return &info; }
       static const ClassInfo info;
  
  
  



More information about the webkit-changes mailing list