top level:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Oct 2005 04:22:50 +0000 (04:22 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Oct 2005 04:22:50 +0000 (04:22 +0000)
        Reviewed by Eric and Darin.

<rdar://problem/4260506> Port JavaScriptGlue to TOT JavaScriptCore

        * Makefile.am:
        * configure.in:

JavaScriptGlue:

        Reviewed by Eric and Darin.

<rdar://problem/4260506> Port JavaScriptGlue to TOT JavaScriptCore

        * JSRun.cpp:
        (JSRun::JSRun):
        (JSRun::GlobalObject):
        * JSRun.h:
        (JSInterpreter::JSInterpreter):
        * JSUtils.cpp:
        (KJSValueToJSObject):
        (JSObjectKJSValue):
        (KJSValueToCFTypeInternal):
        (KJSValueToCFType):
        * JSUtils.h:
        * JSValueWrapper.cpp:
        (JSValueWrapper::JSValueWrapper):
        (JSValueWrapper::GetValue):
        (JSValueWrapper::JSObjectCopyPropertyNames):
        (JSValueWrapper::JSObjectCopyProperty):
        (JSValueWrapper::JSObjectSetProperty):
        (JSValueWrapper::JSObjectCallFunction):
        (JSValueWrapper::JSObjectMark):
        * JSValueWrapper.h:
        * JavaScriptGlue.cpp:
        (JSRunCopyGlobalObject):
        * JavaScriptGlue.xcodeproj/project.pbxproj:
        * Makefile.am: Added.
        * UserObjectImp.cpp:
        (UserObjectPrototypeImp::GlobalUserObjectPrototypeImp):
        (UserObjectImp::UserObjectImp):
        (UserObjectImp::callAsFunction):
        (UserObjectImp::getPropertyNames):
        (UserObjectImp::userObjectGetter):
        (UserObjectImp::getOwnPropertySlot):
        (UserObjectImp::put):
        (UserObjectImp::toPrimitive):
        (UserObjectImp::mark):
        * UserObjectImp.h:
        * kxmlcore/FastMalloc.h: Added.
        * kxmlcore/HashSet.h: Added.

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

14 files changed:
JavaScriptGlue/ChangeLog
JavaScriptGlue/JSRun.cpp
JavaScriptGlue/JSRun.h
JavaScriptGlue/JSUtils.cpp
JavaScriptGlue/JSUtils.h
JavaScriptGlue/JSValueWrapper.cpp
JavaScriptGlue/JSValueWrapper.h
JavaScriptGlue/JavaScriptGlue.cpp
JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
JavaScriptGlue/Makefile.am [new file with mode: 0644]
JavaScriptGlue/UserObjectImp.cpp
JavaScriptGlue/UserObjectImp.h
JavaScriptGlue/kxmlcore/FastMalloc.h [new file with mode: 0644]
JavaScriptGlue/kxmlcore/HashSet.h [new file with mode: 0644]

index 664017f..abb6475 100644 (file)
@@ -1,3 +1,47 @@
+2005-10-05  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Eric and Darin.
+
+       <rdar://problem/4260506> Port JavaScriptGlue to TOT JavaScriptCore
+
+        * JSRun.cpp:
+        (JSRun::JSRun):
+        (JSRun::GlobalObject):
+        * JSRun.h:
+        (JSInterpreter::JSInterpreter):
+        * JSUtils.cpp:
+        (KJSValueToJSObject):
+        (JSObjectKJSValue):
+        (KJSValueToCFTypeInternal):
+        (KJSValueToCFType):
+        * JSUtils.h:
+        * JSValueWrapper.cpp:
+        (JSValueWrapper::JSValueWrapper):
+        (JSValueWrapper::GetValue):
+        (JSValueWrapper::JSObjectCopyPropertyNames):
+        (JSValueWrapper::JSObjectCopyProperty):
+        (JSValueWrapper::JSObjectSetProperty):
+        (JSValueWrapper::JSObjectCallFunction):
+        (JSValueWrapper::JSObjectMark):
+        * JSValueWrapper.h:
+        * JavaScriptGlue.cpp:
+        (JSRunCopyGlobalObject):
+        * JavaScriptGlue.xcodeproj/project.pbxproj:
+        * Makefile.am: Added.
+        * UserObjectImp.cpp:
+        (UserObjectPrototypeImp::GlobalUserObjectPrototypeImp):
+        (UserObjectImp::UserObjectImp):
+        (UserObjectImp::callAsFunction):
+        (UserObjectImp::getPropertyNames):
+        (UserObjectImp::userObjectGetter):
+        (UserObjectImp::getOwnPropertySlot):
+        (UserObjectImp::put):
+        (UserObjectImp::toPrimitive):
+        (UserObjectImp::mark):
+        * UserObjectImp.h:
+        * kxmlcore/FastMalloc.h: Added.
+        * kxmlcore/HashSet.h: Added.
+
 2005-09-14  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Geoff.
index 1548710..da807a4 100644 (file)
@@ -7,7 +7,7 @@
 JSRun::JSRun(CFStringRef source, JSFlags inFlags) 
        :       JSBase(kJSRunTypeID), 
                fSource(CFStringToUString(source)), 
-               fGlobalObject(Object(new ObjectImp())),
+               fGlobalObject(new ObjectImp()),
                fInterpreter(fGlobalObject, inFlags),
                fFlags(inFlags)
 {
@@ -27,7 +27,7 @@ UString JSRun::GetSource() const
        return fSource;
 }
 
-Object JSRun::GlobalObject() const
+ObjectImp *JSRun::GlobalObject() const
 {
        return fGlobalObject;
 }
index 6d6f76c..cc2c4e7 100644 (file)
@@ -10,8 +10,8 @@
 
 class JSInterpreter : public Interpreter {
        public:
-               JSInterpreter(const Object &global, JSFlags flags) : Interpreter(global), fJSFlags(flags) { }
-               JSInterpreter(const Object &global) : Interpreter(global), fJSFlags(kJSFlagNone) { }
+               JSInterpreter(ObjectImp *global, JSFlags flags) : Interpreter(global), fJSFlags(flags) { }
+               JSInterpreter(ObjectImp *global) : Interpreter(global), fJSFlags(kJSFlagNone) { }
                JSInterpreter() : Interpreter(), fJSFlags(kJSFlagNone) { }
                JSInterpreter::~JSInterpreter() { }
                JSFlags Flags() const { return fJSFlags; }
@@ -25,16 +25,16 @@ class JSRun : public JSBase {
                virtual ~JSRun();
 
                UString GetSource() const;
-               Object GlobalObject() const;
+               ObjectImp *GlobalObject() const;
                JSInterpreter* GetInterpreter();
                Completion Evaluate();
                bool CheckSyntax();
                JSFlags Flags() const;
        private:
                UString fSource;                
-               ProtectedObject fGlobalObject;
+               ProtectedPtr<ObjectImp> fGlobalObject;
                JSInterpreter fInterpreter;
                JSFlags fFlags;
 };
 
-#endif
\ No newline at end of file
+#endif
index 592b36e..5bec5be 100644 (file)
@@ -9,6 +9,7 @@
 #include "UserObjectImp.h"
 #include "JSValueWrapper.h"
 #include "JSObject.h"
+#include "JavaScriptCore/IdentifierSequencedSet.h"
 
 struct ObjectImpList {
        ObjectImp* imp;
@@ -16,7 +17,7 @@ struct ObjectImpList {
        CFTypeRef data;
 };
 
-static CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, ObjectImpList* inImps);
+static CFTypeRef KJSValueToCFTypeInternal(ValueImp *inValue, ExecState *exec, ObjectImpList* inImps);
 
 
 //--------------------------------------------------------------------------
@@ -77,44 +78,37 @@ CFStringRef IdentifierToCFString(const Identifier& inIdentifier)
 //--------------------------------------------------------------------------
 //     KJSValueToJSObject
 //--------------------------------------------------------------------------
-JSUserObject*          KJSValueToJSObject(const Value& inValue, ExecState *exec)
+JSUserObject* KJSValueToJSObject(ValueImp *inValue, ExecState *exec)
 {
-       JSUserObject* result = NULL;
-#if JAG_PINK_OR_LATER
-       UserObjectImp* userObjectImp;
-       if (inValue.type() == ObjectType && (userObjectImp = dynamic_cast<UserObjectImp*>(inValue.imp())))
-#else
-       if (UserObjectImp* userObjectImp = dynamic_cast<UserObjectImp*>(inValue.imp()))
-#endif
-       {
-               result =  userObjectImp->GetJSUserObject();
-               if (result) result->Retain();
-       }
-       else
-       {
-               JSValueWrapper* wrapperValue = new JSValueWrapper(inValue, exec);
-               if (wrapperValue)
-               {
-                       JSObjectCallBacks callBacks;
-                       JSValueWrapper::GetJSObectCallBacks(callBacks);
-                       result = (JSUserObject*)JSObjectCreate(wrapperValue, &callBacks);
-                       if (!result)
-                       {
-                               delete wrapperValue;
-                       }
-               }
-       }
-       return result;
+    JSUserObject* result = NULL;
+    
+    if (inValue->isObject(&UserObjectImp::info)) {
+        UserObjectImp* userObjectImp = static_cast<UserObjectImp *>(inValue);
+        result = userObjectImp->GetJSUserObject();
+        if (result) 
+            result->Retain();
+    } else {
+        JSValueWrapper* wrapperValue = new JSValueWrapper(inValue, exec);
+        if (wrapperValue) {
+            JSObjectCallBacks callBacks;
+            JSValueWrapper::GetJSObectCallBacks(callBacks);
+            result = (JSUserObject*)JSObjectCreate(wrapperValue, &callBacks);
+            if (!result) {
+                delete wrapperValue;
+            }
+        }
+    }
+    return result;
 }
 
 //--------------------------------------------------------------------------
 //     JSObjectKJSValue
 //--------------------------------------------------------------------------
-Value JSObjectKJSValue(JSUserObject* ptr)
+ValueImp *JSObjectKJSValue(JSUserObject* ptr)
 {
     InterpreterLock lock;
 
-    Value result = Undefined();
+    ValueImp *result = Undefined();
     if (ptr)
     {
         bool handled = false;
@@ -183,7 +177,7 @@ Value JSObjectKJSValue(JSUserObject* ptr)
         }
         if (!handled)
         {
-            result = Object(new UserObjectImp(ptr));
+            result = new UserObjectImp(ptr);
         }
     }
     return result;
@@ -196,37 +190,35 @@ Value JSObjectKJSValue(JSUserObject* ptr)
 //     KJSValueToCFTypeInternal
 //--------------------------------------------------------------------------
 // Caller is responsible for releasing the returned CFTypeRef
-CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, ObjectImpList* inImps)
+CFTypeRef KJSValueToCFTypeInternal(ValueImp *inValue, ExecState *exec, ObjectImpList* inImps)
 {
-#if JAG_PINK_OR_LATER
-       if (inValue.isNull())
+       if (inValue)
                return NULL;
-#endif
                
        CFTypeRef result = NULL;
        
         InterpreterLock lock;
 
-       switch (inValue.type())
+       switch (inValue->type())
        {
                case BooleanType:
                        {
-                               result = inValue.toBoolean(exec) ? kCFBooleanTrue : kCFBooleanFalse;
+                               result = inValue->toBoolean(exec) ? kCFBooleanTrue : kCFBooleanFalse;
                                RetainCFType(result);
                        }
                        break;
                        
                case StringType:
                        {
-                               UString uString = inValue.toString(exec);
+                               UString uString = inValue->toString(exec);
                                result = UStringToCFString(uString);
                        }
                        break;
                        
                case NumberType:
                        {
-                               double number1 = inValue.toNumber(exec);
-                               double number2 = (double)inValue.toInteger(exec);
+                               double number1 = inValue->toNumber(exec);
+                               double number2 = (double)inValue->toInteger(exec);
                                if (number1 ==  number2)
                                {
                                        int intValue = (int)number2;
@@ -241,8 +233,8 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                        
                case ObjectType:
                        {
-                               if (UserObjectImp* userObjectImp = dynamic_cast<UserObjectImp*>(inValue.imp()))
-                               {
+                            if (inValue->isObject(&UserObjectImp::info)) {
+                                UserObjectImp* userObjectImp = static_cast<UserObjectImp *>(inValue);
                                        JSUserObject* ptr = userObjectImp->GetJSUserObject();
                                        if (ptr)
                                        {
@@ -251,11 +243,11 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                                }
                                else
                                {
-                                       Object object = inValue.toObject(exec);
+                                       ObjectImp *object = inValue->toObject(exec);
                                        UInt8 isArray = false;
 
                                        // if two objects reference each
-                                       ObjectImp* imp = object.imp();
+                                       ObjectImp* imp = object;
                                        ObjectImpList* temp = inImps;
                                        while (temp) {
                                                if (imp == temp->imp) {
@@ -271,21 +263,22 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                                        
 //[...] HACK since we do not have access to the class info we use class name instead
 #if 0
-                                       if (object.inherits(&ArrayInstanceImp::info))
+                                       if (object->inherits(&ArrayInstanceImp::info))
 #else
-                                       if (object.className() == "Array")
+                                       if (object->className() == "Array")
 #endif
                                        {
                                                isArray = true;                                 
 #if JAG_PINK_OR_LATER
                                                JSInterpreter* intrepreter = (JSInterpreter*)exec->dynamicInterpreter();
                                                if (intrepreter && (intrepreter->Flags() & kJSFlagConvertAssociativeArray)) {
-                                                       ReferenceList propList = object.propList(exec, false);
-                                                       ReferenceListIterator iter = propList.begin();
-                                                       ReferenceListIterator end = propList.end();
+                                                       IdentifierSequencedSet propList;
+                                                        object->getPropertyNames(exec, propList);
+                                                       IdentifierSequencedSetIterator iter = propList.begin();
+                                                       IdentifierSequencedSetIterator end = propList.end();
                                                        while(iter != end && isArray)
                                                        {
-                                                               Identifier propName = iter->getPropertyName(exec);
+                                                               Identifier propName = *iter;
                                                                UString ustr = propName.ustring();
                                                                const UniChar* uniChars = (const UniChar*)ustr.data();
                                                                int size = ustr.size();
@@ -295,7 +288,7 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                                                                                break;
                                                                        }
                                                                }
-                                                               iter++;
+                                                               ++iter;
                                                        }
                                                }
 #endif
@@ -304,14 +297,14 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                                        if (isArray)
                                        {                               
                                                // This is an KJS array
-                                               unsigned int length = object.get(exec, "length").toUInt32(exec);
+                                               unsigned int length = object->get(exec, "length")->toUInt32(exec);
                                                result = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
                                                if (result)
                                                {
 #if JAG_PINK_OR_LATER
                                                        for (unsigned i = 0; i < length; i++)
                                                        {
-                                                               CFTypeRef cfValue = KJSValueToCFTypeInternal(object.get(exec, i), exec, &imps);
+                                                               CFTypeRef cfValue = KJSValueToCFTypeInternal(object->get(exec, i), exec, &imps);
                                                                CFArrayAppendValue((CFMutableArrayRef)result, cfValue);
                                                                ReleaseCFType(cfValue);
                                                        }
@@ -330,7 +323,8 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                                        {
 #if JAG_PINK_OR_LATER
                                                // Not an arry, just treat it like a dictionary which contains (property name, property value) paiars
-                                               ReferenceList propList = object.propList(exec, false);
+                                               IdentifierSequencedSet propList;
+                                                object->getPropertyNames(exec, propList);
                                                {
                                                        result = CFDictionaryCreateMutable(NULL, 
                                                                                                                           0, 
@@ -338,15 +332,15 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                                                                                                                           &kCFTypeDictionaryValueCallBacks);
                                                        if (result)
                                                        {
-                                                               ReferenceListIterator iter = propList.begin();
-                                                               ReferenceListIterator end = propList.end();
+                                                               IdentifierSequencedSetIterator iter = propList.begin();
+                                                               IdentifierSequencedSetIterator end = propList.end();
                                                                while(iter != end)
                                                                {
-                                                                       Identifier propName = iter->getPropertyName(exec);
-                                                                       if (object.hasProperty(exec, propName))
+                                                                       Identifier propName = *iter;
+                                                                       if (object->hasProperty(exec, propName))
                                                                        {
                                                                                CFStringRef cfKey = IdentifierToCFString(propName);
-                                                                               CFTypeRef cfValue = KJSValueToCFTypeInternal(object.get(exec, propName), exec, &imps);
+                                                                               CFTypeRef cfValue = KJSValueToCFTypeInternal(object->get(exec, propName), exec, &imps);
                                                                                if (cfKey && cfValue)
                                                                                {
                                                                                        CFDictionaryAddValue((CFMutableDictionaryRef)result, cfKey, cfValue);
@@ -354,7 +348,7 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
                                                                                ReleaseCFType(cfKey);
                                                                                ReleaseCFType(cfValue);
                                                                        }
-                                                                       iter++;
+                                                                       ++iter;
                                                                }
                                                        }
                                                }
@@ -397,7 +391,7 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
 #if !JAG_PINK_OR_LATER
                case ReferenceType:
                        {
-                               Value value = inValue.getValue(exec);
+                               ValueImp *value = inValue->getValue(exec);
                                result = KJSValueToCFTypeInternal(value, exec, NULL);
                        }
                        break;
@@ -445,7 +439,7 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
 
 #if JAG_PINK_OR_LATER
                default:
-                       fprintf(stderr, "KJSValueToCFType: wrong value type %d\n", inValue.type());
+                       fprintf(stderr, "KJSValueToCFType: wrong value type %d\n", inValue->type());
                        break;
 #endif
        }
@@ -453,7 +447,7 @@ CFTypeRef KJSValueToCFTypeInternal(const Value& inValue, ExecState *exec, Object
        return result;
 }
 
-CFTypeRef KJSValueToCFType(const Value& inValue, ExecState *exec)
+CFTypeRef KJSValueToCFType(ValueImp *inValue, ExecState *exec)
 {
        return KJSValueToCFTypeInternal(inValue, exec, NULL);
 }
index 6447743..5c1e3b8 100644 (file)
@@ -43,9 +43,9 @@ CFStringRef UStringToCFString(const UString& inUString);
 Identifier CFStringToIdentifier(CFStringRef inCFString);
 CFStringRef IdentifierToCFString(const Identifier& inIdentifier);
 #endif
-JSUserObject* KJSValueToJSObject(const Value& inValue, ExecState *exec);
-CFTypeRef KJSValueToCFType(const Value& inValue, ExecState *exec);
-Value JSObjectKJSValue(JSUserObject* ptr);
+JSUserObject* KJSValueToJSObject(ValueImp *inValue, ExecState *exec);
+CFTypeRef KJSValueToCFType(ValueImp *inValue, ExecState *exec);
+ValueImp *JSObjectKJSValue(JSUserObject* ptr);
 CFTypeRef GetCFNull(void);
 
 inline CFTypeRef RetainCFType(CFTypeRef x) { if (x) x = CFRetain(x); return x; }
index eb92974..54ced96 100644 (file)
@@ -2,8 +2,9 @@
 // JSValueWrapper.cpp
 //
 #include "JSValueWrapper.h"
+#include "JavaScriptCore/IdentifierSequencedSet.h"
 
-JSValueWrapper::JSValueWrapper(const Value& inValue, ExecState *inExec) 
+JSValueWrapper::JSValueWrapper(ValueImp *inValue, ExecState *inExec) 
        : fValue(inValue), fExec(inExec) 
 { 
 }
@@ -12,7 +13,7 @@ JSValueWrapper::~JSValueWrapper()
 { 
 }
 
-ValueJSValueWrapper::GetValue() 
+ValueImp *JSValueWrapper::GetValue() 
 { 
        return fValue; 
 }
@@ -49,25 +50,15 @@ CFArrayRef JSValueWrapper::JSObjectCopyPropertyNames(void* data)
        if (ptr)
        {
                ExecState* exec = ptr->GetExecState();
-#if JAG_PINK_OR_LATER
-               Object object = ptr->GetValue().toObject(exec);
-               ReferenceList list = object.propList(exec, false);
-               ReferenceListIterator iterator = list.begin();
-#else
-               Object object = ptr->GetValue().imp()->toObject(exec);
-                List list = object.propList(exec, false);
-               ListIterator iterator = list.begin();
-#endif
-
+               ObjectImp *object = ptr->GetValue()->toObject(exec);
+               IdentifierSequencedSet list;
+                object->getPropertyNames(exec, list);
+               IdentifierSequencedSetIterator iterator = list.begin();
 
                while (iterator != list.end()) {
-#if JAG_PINK_OR_LATER
-                       Identifier name = iterator->getPropertyName(exec);
+                       Identifier name = *iterator;
                        CFStringRef nameStr = IdentifierToCFString(name);
-#else
-                       UString name = iterator->getPropertyName(exec);
-                       CFStringRef nameStr = UStringToCFString(name);
-#endif
+
                        if (!result)
                        {
                                result = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
@@ -77,7 +68,7 @@ CFArrayRef JSValueWrapper::JSObjectCopyPropertyNames(void* data)
                                CFArrayAppendValue(result, nameStr);
                        }
                        ReleaseCFType(nameStr);
-                       iterator++;
+                       ++iterator;
                }
 
        }
@@ -94,11 +85,7 @@ JSObjectRef JSValueWrapper::JSObjectCopyProperty(void* data, CFStringRef propert
        if (ptr)
        {
                ExecState* exec = ptr->GetExecState();
-#if JAG_PINK_OR_LATER
-               Value propValue = ptr->GetValue().toObject(exec).get(exec, CFStringToIdentifier(propertyName));
-#else
-               Value propValue = ptr->GetValue().imp()->toObject(exec).get(exec, CFStringToUString(propertyName));
-#endif
+               ValueImp *propValue = ptr->GetValue()->toObject(exec)->get(exec, CFStringToIdentifier(propertyName));
                JSValueWrapper* wrapperValue = new JSValueWrapper(propValue, exec);
 
                JSObjectCallBacks callBacks;
@@ -121,14 +108,9 @@ void JSValueWrapper::JSObjectSetProperty(void* data, CFStringRef propertyName, J
        if (ptr)
        {
                ExecState* exec = ptr->GetExecState();  
-               Value value = JSObjectKJSValue((JSUserObject*)jsValue);
-#if JAG_PINK_OR_LATER
-               Object objValue = ptr->GetValue().toObject(exec);
-               objValue.put(exec, CFStringToIdentifier(propertyName), value);
-#else
-               Object objValue = ptr->GetValue().imp()->toObject(exec);
-               objValue.put(exec, CFStringToUString(propertyName), value);
-#endif
+               ValueImp *value = JSObjectKJSValue((JSUserObject*)jsValue);
+               ObjectImp *objValue = ptr->GetValue()->toObject(exec);
+               objValue->put(exec, CFStringToIdentifier(propertyName), value);
        }
 }
 
@@ -142,25 +124,20 @@ JSObjectRef JSValueWrapper::JSObjectCallFunction(void* data, JSObjectRef thisObj
        {
                ExecState* exec = ptr->GetExecState();  
        
-               Value value = JSObjectKJSValue((JSUserObject*)thisObj);
-#if JAG_PINK_OR_LATER
-               Object ksjThisObj = value.toObject(exec);
-               Object objValue = ptr->GetValue().toObject(exec);
-#else
-               Object ksjThisObj = value.imp()->toObject(exec);
-               Object objValue = ptr->GetValue().imp()->toObject(exec);
-#endif
+               ValueImp *value = JSObjectKJSValue((JSUserObject*)thisObj);
+               ObjectImp *ksjThisObj = value->toObject(exec);
+               ObjectImp *objValue = ptr->GetValue()->toObject(exec);
 
                List listArgs;
                CFIndex argCount = args ? CFArrayGetCount(args) : 0;
                for (CFIndex i = 0; i < argCount; i++)
                {
                        JSObjectRef jsArg = (JSObjectRef)CFArrayGetValueAtIndex(args, i);
-                       Value kgsArg = JSObjectKJSValue((JSUserObject*)jsArg);
+                       ValueImp *kgsArg = JSObjectKJSValue((JSUserObject*)jsArg);
                        listArgs.append(kgsArg);
                }
 
-               Value resultValue = objValue.call(exec, ksjThisObj, listArgs);
+               ValueImp *resultValue = objValue->call(exec, ksjThisObj, listArgs);
                JSValueWrapper* wrapperValue = new JSValueWrapper(resultValue, ptr->GetExecState());
                JSObjectCallBacks callBacks;
                GetJSObectCallBacks(callBacks);
@@ -191,6 +168,6 @@ void JSValueWrapper::JSObjectMark(void* data)
        JSValueWrapper* ptr = (JSValueWrapper*)data;
        if (ptr)
        {
-               ptr->fValue.imp()->mark();
+               ptr->fValue->mark();
        }
 }
index 6ce469e..4851acc 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode: c++; c-basic-offset: 4 -*-
+
 #ifndef __JSValueWrapper_h
 #define __JSValueWrapper_h
 
 #include "JSObject.h"
 
 class JSValueWrapper {
-       public:
-               JSValueWrapper(const Value& inValue, ExecState *inExec);
-               virtual ~JSValueWrapper();
-
-               Value& GetValue();
-               ExecState* GetExecState() const;
-       
-               ProtectedValue fValue;
-               ExecState* fExec;
-
-               static void GetJSObectCallBacks(JSObjectCallBacks& callBacks);
-                       
-       private:
-               static void JSObjectDispose(void* data);
-               static CFArrayRef JSObjectCopyPropertyNames(void* data);
-               static JSObjectRef JSObjectCopyProperty(void* data, CFStringRef propertyName);
-               static void JSObjectSetProperty(void* data, CFStringRef propertyName, JSObjectRef jsValue);
-               static JSObjectRef JSObjectCallFunction(void* data, JSObjectRef thisObj, CFArrayRef args);
-               static CFTypeRef JSObjectCopyCFValue(void* data);
-               static void JSObjectMark(void* data);
+public:
+    JSValueWrapper(ValueImp *inValue, ExecState *inExec);
+    virtual ~JSValueWrapper();
+    
+    ValueImp *GetValue();
+    ExecState* GetExecState() const;
+    
+    ProtectedPtr<ValueImp> fValue;
+    ExecState* fExec;
+    
+    static void GetJSObectCallBacks(JSObjectCallBacks& callBacks);
+    
+private:
+    static void JSObjectDispose(void* data);
+    static CFArrayRef JSObjectCopyPropertyNames(void* data);
+    static JSObjectRef JSObjectCopyProperty(void* data, CFStringRef propertyName);
+    static void JSObjectSetProperty(void* data, CFStringRef propertyName, JSObjectRef jsValue);
+    static JSObjectRef JSObjectCallFunction(void* data, JSObjectRef thisObj, CFArrayRef args);
+    static CFTypeRef JSObjectCopyCFValue(void* data);
+    static void JSObjectMark(void* data);
 };
 
 
-#endif
\ No newline at end of file
+#endif
index 731c6d6..1bbdf1e 100644 (file)
@@ -246,7 +246,7 @@ JSObjectRef JSRunCopyGlobalObject(JSRunRef ref)
        JSRun* ptr = (JSRun*)ref;
        if (ptr)
        {
-               Object globalObject = ptr->GlobalObject();
+               ObjectImp *globalObject = ptr->GlobalObject();
                result = (JSObjectRef)KJSValueToJSObject(globalObject, ptr->GetInterpreter()->globalExec());
        }
        return result;
index cbd6a24..537d75c 100644 (file)
                                GCC_ENABLE_FIX_AND_CONTINUE = YES;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
                                GCC_OPTIMIZATION_LEVEL = 0;
-                               HEADER_SEARCH_PATHS = "";
+                               GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+                               HEADER_SEARCH_PATHS = .;
                                INSTALL_PATH = "$(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks";
                                LIBRARY_SEARCH_PATHS = "";
                                OPTIMIZATION_CFLAGS = "-O0";
                                        __text,
                                        "$(APPLE_INTERNAL_DIR)/OrderFiles/JavaScriptGlue.order",
                                );
-                               WARNING_CFLAGS = (
-                                       "-Wmost",
-                                       "-Wno-four-char-constants",
-                                       "-Wno-unknown-pragmas",
-                               );
                                WRAPPER_EXTENSION = framework;
                                ZERO_LINK = YES;
                        };
                                );
                                FRAMEWORK_VERSION = A;
                                GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               HEADER_SEARCH_PATHS = "";
+                               HEADER_SEARCH_PATHS = .;
                                INSTALL_PATH = "$(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks";
                                LIBRARY_SEARCH_PATHS = "";
                                OTHER_CFLAGS = "";
                                        __text,
                                        "$(APPLE_INTERNAL_DIR)/OrderFiles/JavaScriptGlue.order",
                                );
-                               WARNING_CFLAGS = (
-                                       "-Wmost",
-                                       "-Wno-four-char-constants",
-                                       "-Wno-unknown-pragmas",
-                               );
                                WRAPPER_EXTENSION = framework;
                                ZERO_LINK = NO;
                        };
                                        "$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks",
                                );
                                FRAMEWORK_VERSION = A;
-                               HEADER_SEARCH_PATHS = "";
+                               HEADER_SEARCH_PATHS = .;
                                INSTALL_PATH = "$(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks";
                                LIBRARY_SEARCH_PATHS = "";
                                OTHER_CFLAGS = "";
                                        __text,
                                        "$(APPLE_INTERNAL_DIR)/OrderFiles/JavaScriptGlue.order",
                                );
-                               WARNING_CFLAGS = (
-                                       "-Wmost",
-                                       "-Wno-four-char-constants",
-                                       "-Wno-unknown-pragmas",
-                               );
                                WRAPPER_EXTENSION = framework;
                        };
                        name = Default;
                14AC662C08CE7791006915A8 /* Development */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+                               HEADER_SEARCH_PATHS = .;
+                               WARNING_CFLAGS = (
+                                       "-Wall",
+                                       "-W",
+                                       "-Wcast-align",
+                                       "-Wchar-subscripts",
+                                       "-Wformat-security",
+                                       "-Wmissing-format-attribute",
+                                       "-Wpointer-arith",
+                                       "-Wwrite-strings",
+                                       "-Wno-format-y2k",
+                                       "-Wno-unused-parameter",
+                                       "-Wno-long-double",
+                               );
                        };
                        name = Development;
                };
                14AC662D08CE7791006915A8 /* Deployment */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+                               HEADER_SEARCH_PATHS = .;
+                               WARNING_CFLAGS = (
+                                       "-Wall",
+                                       "-W",
+                                       "-Wcast-align",
+                                       "-Wchar-subscripts",
+                                       "-Wformat-security",
+                                       "-Wmissing-format-attribute",
+                                       "-Wpointer-arith",
+                                       "-Wwrite-strings",
+                                       "-Wno-format-y2k",
+                                       "-Wno-unused-parameter",
+                                       "-Wno-long-double",
+                               );
                        };
                        name = Deployment;
                };
                14AC662E08CE7791006915A8 /* Default */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               GCC_TREAT_WARNINGS_AS_ERRORS = YES;
+                               HEADER_SEARCH_PATHS = .;
+                               WARNING_CFLAGS = (
+                                       "-Wall",
+                                       "-W",
+                                       "-Wcast-align",
+                                       "-Wchar-subscripts",
+                                       "-Wformat-security",
+                                       "-Wmissing-format-attribute",
+                                       "-Wpointer-arith",
+                                       "-Wwrite-strings",
+                                       "-Wno-format-y2k",
+                                       "-Wno-unused-parameter",
+                                       "-Wno-long-double",
+                               );
                        };
                        name = Default;
                };
diff --git a/JavaScriptGlue/Makefile.am b/JavaScriptGlue/Makefile.am
new file mode 100644 (file)
index 0000000..2276b42
--- /dev/null
@@ -0,0 +1,10 @@
+all-am:
+       defaults write com.apple.Xcode PBXProductDirectory "$(SYMROOTS)"
+       defaults write com.apple.Xcode PBXIntermediatesDirectory "$(SYMROOTS)"
+       ../WebKitTools/Scripts/set-webkit-configuration --$(BUILDSTYLE)
+       xcodebuild -configuration $(BUILDSTYLE)
+clean-am:
+       defaults write com.apple.Xcode PBXProductDirectory "$(SYMROOTS)"
+       defaults write com.apple.Xcode PBXIntermediatesDirectory "$(SYMROOTS)"
+       ../WebKitTools/Scripts/set-webkit-configuration --$(BUILDSTYLE)
+       xcodebuild clean -configuration $(BUILDSTYLE)
index 224d9a5..beee2fc 100644 (file)
@@ -1,4 +1,5 @@
 #include "UserObjectImp.h"
+#include "JavaScriptCore/IdentifierSequencedSet.h"
 
 const ClassInfo UserObjectImp::info = {"UserObject", 0, 0, 0};
 
@@ -21,8 +22,8 @@ UserObjectPrototypeImp* UserObjectPrototypeImp::GlobalUserObjectPrototypeImp()
 {
        if (!sUserObjectPrototypeImp)
        {
-               sUserObjectPrototypeImp = new UserObjectPrototypeImp();
-               static ProtectedValue protectPrototype = Value(sUserObjectPrototypeImp);
+            sUserObjectPrototypeImp  = new UserObjectPrototypeImp();
+            static ProtectedPtr<UserObjectPrototypeImp> protectPrototype;
        }
        return sUserObjectPrototypeImp;
 }
@@ -33,7 +34,7 @@ UserObjectImp::UserObjectImp(): ObjectImp(), fJSUserObject(NULL)
 }
 
 UserObjectImp::UserObjectImp(JSUserObject* userObject) : 
-       ObjectImp(Object(UserObjectPrototypeImp::GlobalUserObjectPrototypeImp())), 
+       ObjectImp(UserObjectPrototypeImp::GlobalUserObjectPrototypeImp()), 
        fJSUserObject((JSUserObject*)userObject->Retain()) 
 { 
 }
@@ -56,216 +57,146 @@ bool      UserObjectImp::implementsCall() const
        return fJSUserObject ? fJSUserObject->ImplementsCall() : false; 
 }
 
-Value  UserObjectImp::call(ExecState *exec, Object &thisObj, const List &args)
+ValueImp *UserObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
-       Value result = Undefined();
-       JSUserObject* jsThisObj = KJSValueToJSObject(thisObj, exec);
-       if (jsThisObj)
-       {
-               CFIndex argCount = args.size();
-               CFArrayCallBacks arrayCallBacks;
-               JSTypeGetCFArrayCallBacks(&arrayCallBacks);
-               CFMutableArrayRef jsArgs = CFArrayCreateMutable(NULL, 0, &arrayCallBacks);
-               if (jsArgs)
-               {
-                       for (CFIndex i = 0; i < argCount;  i++)
-                       {
-                               JSUserObject* jsArg = KJSValueToJSObject(args[i], exec);
-                               CFArrayAppendValue(jsArgs, (void*)jsArg);
-                               jsArg->Release();
-                       }
-               }
-
-#if 0
-               JSUserObject* jsResult = fJSUserObject->CallFunction(jsThisObj, jsArgs);
-#else
-               int lockCount = Interpreter::lockCount();
-               int i;
-               for (i = 0; i < lockCount; i++)
-               {
-                       Interpreter::unlock();
-               }
-
-               JSUserObject* jsResult = fJSUserObject->CallFunction(jsThisObj, jsArgs);
-
-               for (i = 0; i < lockCount; i++)
-               {
-                       Interpreter::lock();
-               }
-#endif
-               if (jsResult)
-               {
-                       result = JSObjectKJSValue(jsResult);
-                       jsResult->Release();
-               }
-
-               ReleaseCFType(jsArgs);
-               jsThisObj->Release();
-       }
-       return result;
+    ValueImp *result = Undefined();
+    JSUserObject* jsThisObj = KJSValueToJSObject(thisObj, exec);
+    if (jsThisObj) {
+        CFIndex argCount = args.size();
+        CFArrayCallBacks arrayCallBacks;
+        JSTypeGetCFArrayCallBacks(&arrayCallBacks);
+        CFMutableArrayRef jsArgs = CFArrayCreateMutable(NULL, 0, &arrayCallBacks);
+        if (jsArgs) {
+            for (CFIndex i = 0; i < argCount; i++) {
+                JSUserObject* jsArg = KJSValueToJSObject(args[i], exec);
+                CFArrayAppendValue(jsArgs, (void*)jsArg);
+                jsArg->Release();
+            }
+        }
+
+        int lockCount = Interpreter::lockCount();
+        int i;
+        for (i = 0; i < lockCount; i++) {
+            Interpreter::unlock();
+        }
+        
+        JSUserObject* jsResult = fJSUserObject->CallFunction(jsThisObj, jsArgs);
+        
+        for (i = 0; i < lockCount; i++) {
+            Interpreter::lock();
+        }
+        if (jsResult) {
+            result = JSObjectKJSValue(jsResult);
+            jsResult->Release();
+        }
+
+        ReleaseCFType(jsArgs);
+        jsThisObj->Release();
+    }
+    return result;
 }
 
 
-ReferenceList UserObjectImp::propList(ExecState *exec, bool recursive)
-{
-       ReferenceList propList;
-       JSUserObject* ptr = GetJSUserObject();
-       if (ptr)
-       {
-               Object theObject = toObject(exec);
-               CFArrayRef propertyNames = ptr->CopyPropertyNames();
-               if (propertyNames)
-               {
-                       CFIndex count = CFArrayGetCount(propertyNames);
-                       CFIndex i;
-                       for (i = 0; i < count; i++)
-                       {
-                               CFStringRef propertyName = (CFStringRef)CFArrayGetValueAtIndex(propertyNames, i);
-                               propList.append(Reference(theObject, CFStringToIdentifier(propertyName)));
-                       }
-                       CFRelease(propertyNames);
-               }
-       }
-       return propList;
-}
-
-bool UserObjectImp::hasProperty(ExecState *exec, const Identifier &propertyName) const
+void UserObjectImp::getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames)
 {
-       Value prop = get(exec, propertyName);
-       if (prop.type() != UndefinedType)
-       {
-               return true;
-       }
-       return ObjectImp::hasProperty(exec, propertyName);
+    JSUserObject* ptr = GetJSUserObject();
+    if (ptr) {
+        CFArrayRef cfPropertyNames = ptr->CopyPropertyNames();
+        if (cfPropertyNames) {
+            CFIndex count = CFArrayGetCount(cfPropertyNames);
+            CFIndex i;
+            for (i = 0; i < count; i++) {
+                CFStringRef propertyName = (CFStringRef)CFArrayGetValueAtIndex(cfPropertyNames, i);
+                propertyNames.insert(CFStringToIdentifier(propertyName));
+            }
+            CFRelease(cfPropertyNames);
+        }
+    }
+    ObjectImp::getPropertyNames(exec, propertyNames);
 }
 
-#if JAG_PINK_OR_LATER
-Value  UserObjectImp::get(ExecState *exec, const Identifier &propertyName) const
+ValueImp *UserObjectImp::userObjectGetter(ExecState *, const Identifier& propertyName, const PropertySlot& slot)
 {
-       Value result = Undefined();
-       CFStringRef     cfPropName = IdentifierToCFString(propertyName);
-       JSUserObject* jsResult = fJSUserObject->CopyProperty(cfPropName);
-       if (jsResult)
-       {
-               result = JSObjectKJSValue(jsResult);
-               jsResult->Release();
-       }
-       else
-       {
-               Value kjsValue = toPrimitive(exec);
-               if (kjsValue.type() != NullType && kjsValue.type() != UndefinedType)
-               {
-                       Object kjsObject = kjsValue.toObject(exec);
-                       Value kjsObjectProp = kjsObject.get(exec, propertyName);
-                       result = kjsObjectProp;
-               }
-       }
-       ReleaseCFType(cfPropName);
-       return result;
-
+    UserObjectImp *thisObj = static_cast<UserObjectImp *>(slot.slotBase());
+    CFStringRef        cfPropName = IdentifierToCFString(propertyName);
+    JSUserObject *jsResult = thisObj->fJSUserObject->CopyProperty(cfPropName);
+    ReleaseCFType(cfPropName);
+    ValueImp *result = JSObjectKJSValue(jsResult);
+    jsResult->Release();
+
+    return result;
 }
 
-void   UserObjectImp::put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr)
+bool UserObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
-       CFStringRef     cfPropName = IdentifierToCFString(propertyName);
-       JSUserObject* jsValueObj = KJSValueToJSObject(value, exec);
-
-       fJSUserObject->SetProperty(cfPropName, jsValueObj);
-
-       if (jsValueObj) jsValueObj->Release();  
-       ReleaseCFType(cfPropName);
-}
-#else  //JAG_PINK_OR_LATER
-Value  UserObjectImp::get(ExecState* exec, const UString& propertyName) const
-{
-       Value result = Undefined();
-       CFStringRef     cfPropName = UStringToCFString(propertyName);
-       JSUserObject* jsResult = fJSUserObject->CopyProperty(cfPropName);
-       if (jsResult)
-       {
-               result = JSObjectKJSValue(jsResult);
-               jsResult->Release();
-       }
-       else
-       {
-               Value kjsValue = toPrimitive(exec);
-               if (kjsValue != Null() && kjsValue != Undefined())
-               {
-                       Object kjsObject = kjsValue.toObject(exec);
-                       Value kjsObjectProp = kjsObject.get(exec, propertyName);
-                       result = kjsObjectProp;
-               }
-       }
-       ReleaseCFType(cfPropName);
-       return result;
-
+    CFStringRef        cfPropName = IdentifierToCFString(propertyName);
+    JSUserObject *jsResult = fJSUserObject->CopyProperty(cfPropName);
+    ReleaseCFType(cfPropName);
+    if (jsResult) {
+        slot.setCustom(this, userObjectGetter);
+        jsResult->Release();
+        return true;
+    } else {
+        ValueImp *kjsValue = toPrimitive(exec);
+        if (kjsValue->type() != NullType && kjsValue->type() != UndefinedType) {
+            ObjectImp *kjsObject = kjsValue->toObject(exec);
+            if (kjsObject->getPropertySlot(exec, propertyName, slot))
+                return true;
+        }
+    }
+    return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
 }
 
-void   UserObjectImp::put(ExecState* exec, const UString& propertyName, const Value& value, int attr)
+void UserObjectImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
 {
-       CFStringRef     cfPropName = UStringToCFString(propertyName);
-       JSUserObject* jsValueObj = KJSValueToJSObject(value, exec);
-
-       fJSUserObject->SetProperty(cfPropName, jsValueObj);
-
-       if (jsValueObj) jsValueObj->Release();  
-       ReleaseCFType(cfPropName);
+    CFStringRef        cfPropName = IdentifierToCFString(propertyName);
+    JSUserObject *jsValueObj = KJSValueToJSObject(value, exec);
+    
+    fJSUserObject->SetProperty(cfPropName, jsValueObj);
+    
+    if (jsValueObj) jsValueObj->Release();     
+    ReleaseCFType(cfPropName);
 }
-#endif //JAG_PINK_OR_LATER
         
 JSUserObject* UserObjectImp::GetJSUserObject() const 
 { 
        return fJSUserObject; 
 }
 
-
-
-Value UserObjectImp::toPrimitive(ExecState *exec, Type preferredType) const
+ValueImp *UserObjectImp::toPrimitive(ExecState *exec, Type preferredType) const
 {
-       Value result = Undefined();
-       JSUserObject* jsObjPtr = KJSValueToJSObject(toObject(exec), exec);
-       CFTypeRef cfValue = jsObjPtr ? jsObjPtr->CopyCFValue() : NULL;
-       if (cfValue)
-       {
-               CFTypeID cfType = CFGetTypeID(cfValue);  // toPrimitive
-               if (cfValue == GetCFNull())
-               {
-                       result = Null();
-               }
-               else if (cfType == CFBooleanGetTypeID())
-               {
-                       if (cfValue == kCFBooleanTrue)
-                       {
-                               result = KJS::Boolean(true);
-                       }
-                       else 
-                       {
-                               result = KJS::Boolean(false);
-                       }
-               }
-               else if (cfType == CFStringGetTypeID())
-               {
-                       result = KJS::String(CFStringToUString((CFStringRef)cfValue));
-               }
-               else if (cfType == CFNumberGetTypeID())
-               {
-                       double d = 0.0;
-                       CFNumberGetValue((CFNumberRef)cfValue, kCFNumberDoubleType, &d);
-                       result = KJS::Number(d);
-               }
-               else if (cfType == CFURLGetTypeID())
-               {
-                       CFURLRef absURL = CFURLCopyAbsoluteURL((CFURLRef)cfValue);
-                       if (absURL)
-                       {
-                               result = KJS::String(CFStringToUString(CFURLGetString(absURL)));
-                               ReleaseCFType(absURL);
-                       }
-               }               
-               ReleaseCFType(cfValue);
-       }
-       if (jsObjPtr) jsObjPtr->Release();
-       return result;
+    ValueImp *result = Undefined();
+    JSUserObject* jsObjPtr = KJSValueToJSObject(toObject(exec), exec);
+    CFTypeRef cfValue = jsObjPtr ? jsObjPtr->CopyCFValue() : NULL;
+    if (cfValue) {
+        CFTypeID cfType = CFGetTypeID(cfValue);  // toPrimitive
+        if (cfValue == GetCFNull()) {
+            result = Null();
+        }
+        else if (cfType == CFBooleanGetTypeID()) {
+            if (cfValue == kCFBooleanTrue) {
+                result = KJS::Boolean(true);
+            } else {
+                result = KJS::Boolean(false);
+            }
+        } else if (cfType == CFStringGetTypeID()) {
+            result = KJS::String(CFStringToUString((CFStringRef)cfValue));
+        } else if (cfType == CFNumberGetTypeID()) {
+            double d = 0.0;
+            CFNumberGetValue((CFNumberRef)cfValue, kCFNumberDoubleType, &d);
+            result = KJS::Number(d);
+        } else if (cfType == CFURLGetTypeID()) {
+            CFURLRef absURL = CFURLCopyAbsoluteURL((CFURLRef)cfValue);
+            if (absURL) {
+                result = KJS::String(CFStringToUString(CFURLGetString(absURL)));
+                ReleaseCFType(absURL);
+            }
+        }              
+        ReleaseCFType(cfValue);
+    }
+    if (jsObjPtr) 
+        jsObjPtr->Release();
+    return result;
 }
 
 
@@ -480,9 +411,8 @@ UString UserObjectImp::toString(ExecState *exec) const
 
 void UserObjectImp::mark()
 {
-       ObjectImp::mark(); // call parent to mark self
-       if (fJSUserObject)
-       {
-               fJSUserObject->Mark(); // mark child
-       }
+    ObjectImp::mark(); // call parent to mark self
+    if (fJSUserObject) {
+        fJSUserObject->Mark(); // mark child
+    }
 }
index 6d4650c..377cfcc 100644 (file)
@@ -1,3 +1,5 @@
+// -*- mode: c++; c-basic-offset: 4 -*-
+
 #ifndef __UserObjectImp_h
 #define __UserObjectImp_h
 
 
 class UserObjectImp : public ObjectImp
 {
-    public:
-        UserObjectImp(JSUserObject* userObject);
-        virtual                        ~UserObjectImp();
+public:
+    UserObjectImp(JSUserObject* userObject);
+    virtual ~UserObjectImp();
     
-        virtual        const ClassInfo *classInfo() const;
-        static const ClassInfo info;
-        
-        virtual bool   implementsCall() const;
-
-               virtual bool hasProperty(ExecState *exec, const Identifier &propertyName) const;
-               virtual ReferenceList UserObjectImp::propList(ExecState *exec, bool recursive=true);
-
-        virtual Value  call(ExecState *exec, Object &thisObj, const List &args);
-#if JAG_PINK_OR_LATER
-               virtual Value   get(ExecState *exec, const Identifier &propertyName) const;
-               virtual void    put(ExecState *exec, const Identifier &propertyName, const Value &value, int attr = None);
-#else
-        virtual Value  get(ExecState* exec, const UString& propertyName) const;
-        virtual void   put(ExecState* exec, const UString& propertyName, const Value& value, int attr = None);
-#endif
-
-               virtual Value toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const;
-               virtual bool toBoolean(ExecState *exec) const;
-               virtual double toNumber(ExecState *exec) const;
-               virtual UString toString(ExecState *exec) const;
+    virtual const ClassInfo *classInfo() const;
+    static const ClassInfo info;
+    
+    virtual bool implementsCall() const;
+    
+    virtual void getPropertyNames(ExecState *exec, IdentifierSequencedSet& propertyNames);
+    
+    virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args);
+    virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
+    virtual void put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr = None);
+    
+    ValueImp *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const;
+    virtual bool toBoolean(ExecState *exec) const;
+    virtual double toNumber(ExecState *exec) const;
+    virtual UString toString(ExecState *exec) const;
+    
+    virtual void mark();
+    
+    JSUserObject* GetJSUserObject() const;
+protected:
+    UserObjectImp();
+private:
+    static ValueImp *userObjectGetter(ExecState *, const Identifier&, const PropertySlot&);
 
-        
-               virtual void mark();
-               
-        JSUserObject* GetJSUserObject() const;
-       protected:
-               UserObjectImp();
-    private:
-        JSUserObject* fJSUserObject;
+    JSUserObject* fJSUserObject;
 };
 
 
-#endif
\ No newline at end of file
+#endif
diff --git a/JavaScriptGlue/kxmlcore/FastMalloc.h b/JavaScriptGlue/kxmlcore/FastMalloc.h
new file mode 100644 (file)
index 0000000..1701231
--- /dev/null
@@ -0,0 +1 @@
+#include <JavaScriptCore/FastMalloc.h>
diff --git a/JavaScriptGlue/kxmlcore/HashSet.h b/JavaScriptGlue/kxmlcore/HashSet.h
new file mode 100644 (file)
index 0000000..cfe2d80
--- /dev/null
@@ -0,0 +1 @@
+#include <JavaScriptCore/HashSet.h>