Title: [87374] trunk/Source/WebCore
Revision
87374
Author
[email protected]
Date
2011-05-26 04:46:48 -0700 (Thu, 26 May 2011)

Log Message

2011-05-26  Andreas Kling  <[email protected]>

        Reviewed by Darin Adler.

        JSC DOM bindings: Use isUndefinedOrNull() instead of (isNull() || isUndefined()).
        https://bugs.webkit.org/show_bug.cgi?id=61472

        * bindings/scripts/CodeGeneratorJS.pm:
        * bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87373 => 87374)


--- trunk/Source/WebCore/ChangeLog	2011-05-26 10:53:20 UTC (rev 87373)
+++ trunk/Source/WebCore/ChangeLog	2011-05-26 11:46:48 UTC (rev 87374)
@@ -1,3 +1,15 @@
+2011-05-26  Andreas Kling  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        JSC DOM bindings: Use isUndefinedOrNull() instead of (isNull() || isUndefined()).
+        https://bugs.webkit.org/show_bug.cgi?id=61472
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        * bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
+        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
+
 2011-05-26  Keishi Hattori  <[email protected]>
 
         Reviewed by Kent Tamura.

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (87373 => 87374)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2011-05-26 10:53:20 UTC (rev 87373)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2011-05-26 11:46:48 UTC (rev 87374)
@@ -1151,7 +1151,7 @@
         # these are acceptable values for a DOMString argument (any Object can
         # be converted to a string via .toString).
         if ($codeGenerator->IsStringType($type)) {
-            push(@andExpression, "(${value}.isNull() || ${value}.isUndefined() || ${value}.isString() || ${value}.isObject())");
+            push(@andExpression, "(${value}.isUndefinedOrNull() || ${value}.isString() || ${value}.isObject())");
         } elsif ($parameter->extendedAttributes->{"Callback"}) {
             # For Callbacks only checks if the value is null or object.
             push(@andExpression, "(${value}.isNull() || ${value}.isObject())");
@@ -2009,7 +2009,7 @@
                             $implIncludes{"$callbackClassName.h"} = 1;
                             if ($parameter->extendedAttributes->{"Optional"}) {
                                 push(@implContent, "    RefPtr<$argType> $name;\n");
-                                push(@implContent, "    if (exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isNull() && !exec->argument($argsIndex).isUndefined()) {\n");
+                                push(@implContent, "    if (exec->argumentCount() > $argsIndex && !exec->argument($argsIndex).isUndefinedOrNull()) {\n");
                                 push(@implContent, "        if (!exec->argument($argsIndex).isObject()) {\n");
                                 push(@implContent, "            setDOMException(exec, TYPE_MISMATCH_ERR);\n");
                                 push(@implContent, "            return JSValue::encode(jsUndefined());\n");

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (87373 => 87374)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2011-05-26 10:53:20 UTC (rev 87373)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2011-05-26 11:46:48 UTC (rev 87374)
@@ -1510,7 +1510,7 @@
     ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
     TestObj* imp = static_cast<TestObj*>(castedThis->impl());
     RefPtr<TestCallback> callback;
-    if (exec->argumentCount() > 0 && !exec->argument(0).isNull() && !exec->argument(0).isUndefined()) {
+    if (exec->argumentCount() > 0 && !exec->argument(0).isUndefinedOrNull()) {
         if (!exec->argument(0).isObject()) {
             setDOMException(exec, TYPE_MISMATCH_ERR);
             return JSValue::encode(jsUndefined());
@@ -1619,11 +1619,11 @@
 
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
 {
-    if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
+    if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) && (exec->argument(1).isUndefinedOrNull() || exec->argument(1).isString() || exec->argument(1).isObject())))
         return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
     if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || (exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)))))
         return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
-    if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isUndefined() || exec->argument(0).isString() || exec->argument(0).isObject())))
+    if ((exec->argumentCount() == 1 && (exec->argument(0).isUndefinedOrNull() || exec->argument(0).isString() || exec->argument(0).isObject())))
         return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
     if (exec->argumentCount() == 1)
         return jsTestObjPrototypeFunctionOverloadedMethod4(exec);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to