top level:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2005 00:53:05 +0000 (00:53 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Nov 2005 00:53:05 +0000 (00:53 +0000)
Reviewed by: Eric.

        <rdar://problem/4324107> get JavaScriptGlue working with TOT JavaScriptCore again

        * Makefile.am: re-enable JavaScriptGlue in the build

JavaScriptGlue:

Reviewed by: Eric.

        <rdar://problem/4324107> get JavaScriptGlue working with TOT JavaScriptCore again

- reverted all this stuff to use ReferenceList instead of IdentifierSequencedSet

        * JSUtils.cpp:
        (KJSValueToCFTypeInternal):
        * JSValueWrapper.cpp:
        (JSValueWrapper::JSObjectCopyPropertyNames):
        * UserObjectImp.cpp:
        (UserObjectImp::propList):
        * UserObjectImp.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptGlue/ChangeLog
JavaScriptGlue/JSUtils.cpp
JavaScriptGlue/JSValueWrapper.cpp
JavaScriptGlue/UserObjectImp.cpp
JavaScriptGlue/UserObjectImp.h

index 0fb3c7d..f9ea969 100644 (file)
@@ -1,3 +1,19 @@
+2005-11-01  Maciej Stachowiak  <mjs@apple.com>
+
+       Reviewed by: Eric.
+       
+        <rdar://problem/4324107> get JavaScriptGlue working with TOT JavaScriptCore again
+
+       - reverted all this stuff to use ReferenceList instead of IdentifierSequencedSet
+
+        * JSUtils.cpp:
+        (KJSValueToCFTypeInternal):
+        * JSValueWrapper.cpp:
+        (JSValueWrapper::JSObjectCopyPropertyNames):
+        * UserObjectImp.cpp:
+        (UserObjectImp::propList):
+        * UserObjectImp.h:
+
 2005-10-11  Timothy Hatcher  <timothy@apple.com>
 
         Setup the proper Framework search path for the Default config.
index df18285..cd80f43 100644 (file)
@@ -9,7 +9,7 @@
 #include "UserObjectImp.h"
 #include "JSValueWrapper.h"
 #include "JSObject.h"
-#include "JavaScriptCore/IdentifierSequencedSet.h"
+#include "JavaScriptCore/reference_list.h"
 
 struct ObjectImpList {
     ObjectImp* imp;
@@ -269,13 +269,12 @@ CFTypeRef KJSValueToCFTypeInternal(ValueImp *inValue, ExecState *exec, ObjectImp
                         isArray = true;
                         JSInterpreter* intrepreter = (JSInterpreter*)exec->dynamicInterpreter();
                         if (intrepreter && (intrepreter->Flags() & kJSFlagConvertAssociativeArray)) {
-                            IdentifierSequencedSet propList;
-                                                        object->getPropertyNames(exec, propList);
-                            IdentifierSequencedSetIterator iter = propList.begin();
-                            IdentifierSequencedSetIterator end = propList.end();
+                            ReferenceList propList = object->propList(exec);
+                            ReferenceListIterator iter = propList.begin();
+                            ReferenceListIterator end = propList.end();
                             while(iter != end && isArray)
                             {
-                                Identifier propName = *iter;
+                                Identifier propName = iter->getPropertyName(exec);
                                 UString ustr = propName.ustring();
                                 const UniChar* uniChars = (const UniChar*)ustr.data();
                                 int size = ustr.size();
@@ -285,7 +284,7 @@ CFTypeRef KJSValueToCFTypeInternal(ValueImp *inValue, ExecState *exec, ObjectImp
                                         break;
                                     }
                                 }
-                                ++iter;
+                                iter++;
                             }
                         }
                     }
@@ -308,8 +307,7 @@ CFTypeRef KJSValueToCFTypeInternal(ValueImp *inValue, ExecState *exec, ObjectImp
                     else
                     {
                         // Not an array, just treat it like a dictionary which contains (property name, property value) pairs
-                        IdentifierSequencedSet propList;
-                                                object->getPropertyNames(exec, propList);
+                        ReferenceList propList = object->propList(exec);
                         {
                             result = CFDictionaryCreateMutable(0,
                                                                0,
@@ -317,11 +315,11 @@ CFTypeRef KJSValueToCFTypeInternal(ValueImp *inValue, ExecState *exec, ObjectImp
                                                                &kCFTypeDictionaryValueCallBacks);
                             if (result)
                             {
-                                IdentifierSequencedSetIterator iter = propList.begin();
-                                IdentifierSequencedSetIterator end = propList.end();
+                                ReferenceListIterator iter = propList.begin();
+                                ReferenceListIterator end = propList.end();
                                 while(iter != end)
                                 {
-                                    Identifier propName = *iter;
+                                    Identifier propName = iter->getPropertyName(exec);
                                     if (object->hasProperty(exec, propName))
                                     {
                                         CFStringRef cfKey = IdentifierToCFString(propName);
@@ -333,7 +331,7 @@ CFTypeRef KJSValueToCFTypeInternal(ValueImp *inValue, ExecState *exec, ObjectImp
                                         ReleaseCFType(cfKey);
                                         ReleaseCFType(cfValue);
                                     }
-                                    ++iter;
+                                    iter++;
                                 }
                             }
                         }
index 910f48b..6b18fec 100644 (file)
@@ -2,7 +2,7 @@
 // JSValueWrapper.cpp
 //
 #include "JSValueWrapper.h"
-#include "JavaScriptCore/IdentifierSequencedSet.h"
+#include "JavaScriptCore/reference_list.h"
 
 JSValueWrapper::JSValueWrapper(ValueImp *inValue, ExecState *inExec)
     : fValue(inValue), fExec(inExec)
@@ -51,12 +51,11 @@ CFArrayRef JSValueWrapper::JSObjectCopyPropertyNames(void *data)
     {
         ExecState* exec = ptr->GetExecState();
         ObjectImp *object = ptr->GetValue()->toObject(exec);
-        IdentifierSequencedSet list;
-                object->getPropertyNames(exec, list);
-        IdentifierSequencedSetIterator iterator = list.begin();
+        ReferenceList list = object->propList(exec);
+        ReferenceListIterator iterator = list.begin();
 
         while (iterator != list.end()) {
-            Identifier name = *iterator;
+            Identifier name = iterator->getPropertyName(exec);
             CFStringRef nameStr = IdentifierToCFString(name);
 
             if (!result)
@@ -68,7 +67,7 @@ CFArrayRef JSValueWrapper::JSObjectCopyPropertyNames(void *data)
                 CFArrayAppendValue(result, nameStr);
             }
             ReleaseCFType(nameStr);
-            ++iterator;
+            iterator++;
         }
 
     }
index 0731495..34517fa 100644 (file)
@@ -1,5 +1,5 @@
 #include "UserObjectImp.h"
-#include "JavaScriptCore/IdentifierSequencedSet.h"
+#include "JavaScriptCore/reference_list.h"
 
 const ClassInfo UserObjectImp::info = {"UserObject", 0, 0, 0};
 
@@ -97,8 +97,9 @@ ValueImp *UserObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, con
 }
 
 
-void UserObjectImp::getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames)
+ReferenceList UserObjectImp::propList(ExecState *exec, bool recursive)
 {
+    ReferenceList list = ObjectImp::propList(exec, recursive);
     JSUserObject* ptr = GetJSUserObject();
     if (ptr) {
         CFArrayRef cfPropertyNames = ptr->CopyPropertyNames();
@@ -107,12 +108,13 @@ void UserObjectImp::getPropertyNames(ExecState *exec, IdentifierSequencedSet& pr
             CFIndex i;
             for (i = 0; i < count; i++) {
                 CFStringRef propertyName = (CFStringRef)CFArrayGetValueAtIndex(cfPropertyNames, i);
-                propertyNames.insert(CFStringToIdentifier(propertyName));
+                list.append(Reference(this, CFStringToIdentifier(propertyName)));
             }
             CFRelease(cfPropertyNames);
         }
     }
-    ObjectImp::getPropertyNames(exec, propertyNames);
+
+    return list;
 }
 
 ValueImp *UserObjectImp::userObjectGetter(ExecState *, const Identifier& propertyName, const PropertySlot& slot)
index 06220e7..28faaa2 100644 (file)
@@ -20,7 +20,7 @@ public:
 
     virtual bool implementsCall() const;
 
-    virtual void getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames);
+    virtual ReferenceList propList(ExecState *exec, bool recursive = true);
 
     virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
     virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);