Unreviewed, rolling out r95466.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 21:28:06 +0000 (21:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Sep 2011 21:28:06 +0000 (21:28 +0000)
http://trac.webkit.org/changeset/95466
https://bugs.webkit.org/show_bug.cgi?id=68389

Incorrect version of the patch. (Requested by mhahnenberg on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-09-19

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* runtime/JSCell.cpp:
(JSC::JSCell::toPrimitive):
* runtime/JSCell.h:
(JSC::JSCell::JSValue::toPrimitive):
* runtime/JSNotAnObject.cpp:
(JSC::JSNotAnObject::toPrimitive):
* runtime/JSNotAnObject.h:
* runtime/JSObject.h:
* runtime/JSString.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/runtime/JSCell.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSNotAnObject.cpp
Source/JavaScriptCore/runtime/JSNotAnObject.h
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSString.h

index f679586..e2e96f2 100644 (file)
@@ -1,3 +1,23 @@
+2011-09-19  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r95466.
+        http://trac.webkit.org/changeset/95466
+        https://bugs.webkit.org/show_bug.cgi?id=68389
+
+        Incorrect version of the patch. (Requested by mhahnenberg on
+        #webkit).
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * runtime/JSCell.cpp:
+        (JSC::JSCell::toPrimitive):
+        * runtime/JSCell.h:
+        (JSC::JSCell::JSValue::toPrimitive):
+        * runtime/JSNotAnObject.cpp:
+        (JSC::JSNotAnObject::toPrimitive):
+        * runtime/JSNotAnObject.h:
+        * runtime/JSObject.h:
+        * runtime/JSString.h:
+
 2011-09-19  Mark Hahnenberg  <mhahnenberg@apple.com>
 
         Remove toPrimitive from JSCell
index 763dd00..85a157f 100644 (file)
@@ -356,6 +356,8 @@ EXPORTS
     ?toObject@JSCell@JSC@@UBEPAVJSObject@2@PAVExecState@2@PAVJSGlobalObject@2@@Z
     ?toObject@JSObject@JSC@@UBEPAV12@PAVExecState@2@PAVJSGlobalObject@2@@Z
     ?toObjectSlowCase@JSValue@JSC@@ABEPAVJSObject@2@PAVExecState@2@PAVJSGlobalObject@2@@Z
+    ?toPrimitive@JSCell@JSC@@UBE?AVJSValue@2@PAVExecState@2@W4PreferredPrimitiveType@2@@Z
+    ?toPrimitive@JSString@JSC@@EBE?AVJSValue@2@PAVExecState@2@W4PreferredPrimitiveType@2@@Z
     ?toStrictThisObject@JSObject@JSC@@UBE?AVJSValue@2@PAVExecState@2@@Z
     ?toString@JSCell@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
     ?toString@JSObject@JSC@@UBE?AVUString@2@PAVExecState@2@@Z
index 7b7c604..9a93c59 100644 (file)
 
 namespace JSC {
 
-JSValue JSCell::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const
-{
-    if (isString())
-        return static_cast<const JSString*>(this)->toPrimitive(exec, preferredType);
-    return static_cast<const JSObject*>(this)->toPrimitive(exec, preferredType);
-}
-
 bool JSCell::getString(ExecState* exec, UString&stringValue) const
 {
     if (!isString())
@@ -124,6 +117,12 @@ JSValue JSCell::getJSNumber()
     return JSValue();
 }
 
+JSValue JSCell::toPrimitive(ExecState*, PreferredPrimitiveType) const
+{
+    ASSERT_NOT_REACHED();
+    return JSValue();
+}
+
 bool JSCell::getPrimitiveNumber(ExecState*, double&, JSValue&)
 {
     ASSERT_NOT_REACHED();
index 35d68af..fd02662 100644 (file)
@@ -102,7 +102,7 @@ namespace JSC {
         virtual ConstructType getConstructData(ConstructData&);
 
         // Basic conversions.
-        JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
+        virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
         virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue&);
         virtual bool toBoolean(ExecState*) const;
         virtual double toNumber(ExecState*) const;
@@ -285,6 +285,11 @@ namespace JSC {
         return false;
     }
 
+    inline JSValue JSValue::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const
+    {
+        return isCell() ? asCell()->toPrimitive(exec, preferredType) : asValue();
+    }
+
     inline bool JSValue::getPrimitiveNumber(ExecState* exec, double& number, JSValue& value)
     {
         if (isInt32()) {
index 03b67d5..5f948f4 100644 (file)
@@ -37,7 +37,7 @@ namespace JSC {
 ASSERT_CLASS_FITS_IN_CELL(JSNotAnObject);
 
 // JSValue methods
-JSValue JSNotAnObject::defaultValue(ExecState* exec, PreferredPrimitiveType) const
+JSValue JSNotAnObject::toPrimitive(ExecState* exec, PreferredPrimitiveType) const
 {
     ASSERT_UNUSED(exec, exec->hadException());
     return jsNumber(0);
index 7c8e63c..21fe429 100644 (file)
@@ -63,7 +63,7 @@ namespace JSC {
         static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesGetPropertyNames | JSObject::StructureFlags;
 
         // JSValue methods
-        virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
+        virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
         virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue&);
         virtual bool toBoolean(ExecState*) const;
         virtual double toNumber(ExecState*) const;
index 3b98c38..f1a217b 100644 (file)
@@ -132,7 +132,7 @@ namespace JSC {
         virtual void getPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
 
-        JSValue toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const;
+        virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const;
         virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue& value);
         virtual bool toBoolean(ExecState*) const;
         virtual double toNumber(ExecState*) const;
index 6237f8d..7b0dce2 100644 (file)
@@ -426,7 +426,6 @@ namespace JSC {
         }
         unsigned length() { return m_length; }
 
-        JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
         bool getStringPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
         bool getStringPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
         bool getStringPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&);
@@ -493,6 +492,7 @@ namespace JSC {
             }
         }
 
+        virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const;
         virtual bool getPrimitiveNumber(ExecState*, double& number, JSValue& value);
         virtual bool toBoolean(ExecState*) const;
         virtual double toNumber(ExecState*) const;
@@ -682,13 +682,6 @@ namespace JSC {
 
     // --- JSValue inlines ----------------------------
 
-    inline JSValue JSValue::toPrimitive(ExecState* exec, PreferredPrimitiveType preferredType) const
-    {
-        if (!isCell())
-            return asValue();
-        return asCell()->toPrimitive(exec, preferredType);
-    }
-
     inline UString JSValue::toString(ExecState* exec) const
     {
         if (isString())