Fix a bug and improve upon Brady's fix
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 01:41:11 +0000 (01:41 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 01:41:11 +0000 (01:41 +0000)
        Reviewed by Anders.

        * bindings/js/JSSQLTransactionCustom.cpp:
        (WebCore::JSSQLTransaction::executeSql): Made the code a little
        clearer and more correct.
        * loader/icon/IconDatabase.cpp: Put parentheses around the expansion
        of IS_ICON_SYNC_THREAD() so that ASSERT_NOT_SYNC_THREAD() does the
        comparison it meant to.

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

WebCore/ChangeLog
WebCore/bindings/js/JSSQLTransactionCustom.cpp
WebCore/loader/icon/IconDatabase.cpp

index dff9081..61eaa43 100644 (file)
@@ -1,3 +1,16 @@
+2007-11-13  Adam Roben  <aroben@apple.com>
+
+        Fix a bug and improve upon Brady's fix
+
+        Reviewed by Anders.
+
+        * bindings/js/JSSQLTransactionCustom.cpp:
+        (WebCore::JSSQLTransaction::executeSql): Made the code a little
+        clearer and more correct.
+        * loader/icon/IconDatabase.cpp: Put parentheses around the expansion
+        of IS_ICON_SYNC_THREAD() so that ASSERT_NOT_SYNC_THREAD() does the
+        comparison it meant to.
+
 2007-11-13  Sam Weinig  <sam@webkit.org>
 
         Fix Qt and Gtk builds.
index 5414adb..4573557 100644 (file)
@@ -71,9 +71,9 @@ JSValue* JSSQLTransaction::executeSql(ExecState* exec, const List& args)
     }
 
     RefPtr<SQLStatementCallback> callback;
-    if (args.size() > 2) {
-        JSObject* object = 0;
-        if (!args[2]->isNull() && !(object = args[2]->getObject())) {
+    if (args.size() > 2 && !args[2]->isNull()) {
+        JSObject* object = args[2]->getObject();
+        if (!object) {
             setDOMException(exec, TYPE_MISMATCH_ERR);
             return jsUndefined();
         }
@@ -83,9 +83,9 @@ JSValue* JSSQLTransaction::executeSql(ExecState* exec, const List& args)
     }
     
     RefPtr<SQLStatementErrorCallback> errorCallback;
-    if (args.size() > 3) {
-        JSObject* object = 0;
-        if (!args[3]->isNull() && !(object = args[3]->getObject())) {
+    if (args.size() > 3 && !args[3]->isNull()) {
+        JSObject* object = args[3]->getObject();
+        if (!object) {
             setDOMException(exec, TYPE_MISMATCH_ERR);
             return jsUndefined();
         }
index bf6df5a..cdbc5be 100644 (file)
@@ -60,7 +60,7 @@
 #define ASSERT_NOT_SYNC_THREAD() ASSERT(!m_syncThreadRunning || !IS_ICON_SYNC_THREAD())
 
 // For methods that are meant to support the sync thread ONLY
-#define IS_ICON_SYNC_THREAD() m_syncThread == currentThread()
+#define IS_ICON_SYNC_THREAD() (m_syncThread == currentThread())
 #define ASSERT_ICON_SYNC_THREAD() ASSERT(IS_ICON_SYNC_THREAD())
 
 namespace WebCore {