[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:26:34 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3caaad3e9a91712cc77c97d55d64a8def740df3f
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 23 16:10:51 2010 +0000

    2010-07-23  Jedrzej Nowacki  <jedrzej.nowacki at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            QScriptValue::equals benchmark crash fix.
    
            Patch changes QScriptValue::equals implementation to cover
            more edge cases.
    
            Problem exposes an issue in our autotests (all values got
            bound to an engine too fast - bug 42366).
    
            [Qt] QScriptValue::equals asserts
            https://bugs.webkit.org/show_bug.cgi?id=42363
    
            * api/qscriptvalue_p.h:
            (QScriptValuePrivate::equals):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/qt/ChangeLog b/JavaScriptCore/qt/ChangeLog
index 448a59e..2303a53 100644
--- a/JavaScriptCore/qt/ChangeLog
+++ b/JavaScriptCore/qt/ChangeLog
@@ -1,3 +1,21 @@
+2010-07-23  Jedrzej Nowacki  <jedrzej.nowacki at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        QScriptValue::equals benchmark crash fix.
+
+        Patch changes QScriptValue::equals implementation to cover
+        more edge cases.
+
+        Problem exposes an issue in our autotests (all values got
+        bound to an engine too fast - bug 42366).
+
+        [Qt] QScriptValue::equals asserts
+        https://bugs.webkit.org/show_bug.cgi?id=42363
+
+        * api/qscriptvalue_p.h:
+        (QScriptValuePrivate::equals):
+
 2010-07-14  Jedrzej Nowacki  <jedrzej.nowacki at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/JavaScriptCore/qt/api/qscriptvalue_p.h b/JavaScriptCore/qt/api/qscriptvalue_p.h
index 6e93a07..6fbf98b 100644
--- a/JavaScriptCore/qt/api/qscriptvalue_p.h
+++ b/JavaScriptCore/qt/api/qscriptvalue_p.h
@@ -699,16 +699,48 @@ bool QScriptValuePrivate::equals(QScriptValuePrivate* other)
     if (!other->isValid())
         return false;
 
-    if ((m_state == other->m_state) && !isJSBased()) {
-        if (isNumberBased())
-            return u.m_number == other->u.m_number;
-        Q_ASSERT(isStringBased());
-        return *u.m_string == *(other->u.m_string);
+    if (!isJSBased() && !other->isJSBased()) {
+        switch (m_state) {
+        case CNull:
+        case CUndefined:
+            return other->isUndefined() || other->isNull();
+        case CNumber:
+            switch (other->m_state) {
+            case CBool:
+            case CString:
+                return u.m_number == other->toNumber();
+            case CNumber:
+                return u.m_number == other->u.m_number;
+            default:
+                return false;
+            }
+        case CBool:
+            switch (other->m_state) {
+            case CBool:
+                return u.m_bool == other->u.m_bool;
+            case CNumber:
+                return toNumber() == other->u.m_number;
+            case CString:
+                return toNumber() == other->toNumber();
+            default:
+                return false;
+            }
+        case CString:
+            switch (other->m_state) {
+            case CBool:
+                return toNumber() == other->toNumber();
+            case CNumber:
+                return toNumber() == other->u.m_number;
+            case CString:
+                return *u.m_string == *other->u.m_string;
+            default:
+                return false;
+            }
+        default:
+            Q_ASSERT_X(false, "equals()", "Not all states are included in the previous switch statement.");
+        }
     }
 
-    if (!isJSBased() && !other->isJSBased())
-        return false;
-
     if (isJSBased() && !other->isJSBased()) {
         if (!other->assignEngine(engine())) {
             qWarning("equals(): Cannot compare to a value created in a different engine");

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list