Title: [153546] trunk/Source
Revision
153546
Author
[email protected]
Date
2013-07-31 16:54:09 -0700 (Wed, 31 Jul 2013)

Log Message

Use emptyString instead of String("")
https://bugs.webkit.org/show_bug.cgi?id=119335

Reviewed by Darin Adler.

Use emptyString() instead of String("") because it is better style and
faster. This is a followup to r116908, removing all occurrences of
String("") from WebKit.

Source/_javascript_Core:

* runtime/RegExpConstructor.cpp:
(JSC::constructRegExp):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):

Source/WebCore:

No behavior change, no new tests needed.

* platform/graphics/blackberry/LayerAnimation.h:
(WebCore::LayerAnimation::name):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::textFromEvent):
(WebCore::unmodifiedTextFromEvent):
(WebCore::keyIdentifierForKeyEvent):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::userAgent):

Source/WebKit/qt:

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::runJavaScriptPrompt):

Source/WebKit2:

* Shared/mac/WebEventFactory.mm:
(WebKit::textFromEvent):
(WebKit::unmodifiedTextFromEvent):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (153545 => 153546)


--- trunk/Source/_javascript_Core/ChangeLog	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-07-31 23:54:09 UTC (rev 153546)
@@ -1,3 +1,22 @@
+2013-07-31  Kwang Yul Seo  <[email protected]>
+
+        Use emptyString instead of String("")
+        https://bugs.webkit.org/show_bug.cgi?id=119335
+
+        Reviewed by Darin Adler.
+
+        Use emptyString() instead of String("") because it is better style and
+        faster. This is a followup to r116908, removing all occurrences of
+        String("") from WebKit.
+
+        * runtime/RegExpConstructor.cpp:
+        (JSC::constructRegExp):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::regExpProtoFuncCompile):
+        * runtime/StringPrototype.cpp:
+        (JSC::stringProtoFuncMatch):
+        (JSC::stringProtoFuncSearch):
+
 2013-07-31  Ruth Fong  <[email protected]>
 
         <input type=color> Mac UI behaviour

Modified: trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp (153545 => 153546)


--- trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp	2013-07-31 23:54:09 UTC (rev 153546)
@@ -270,7 +270,7 @@
         return asObject(arg0);
     }
 
-    String pattern = arg0.isUndefined() ? String("") : arg0.toString(exec)->value(exec);
+    String pattern = arg0.isUndefined() ? emptyString() : arg0.toString(exec)->value(exec);
     if (exec->hadException())
         return 0;
 

Modified: trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp (153545 => 153546)


--- trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/_javascript_Core/runtime/RegExpPrototype.cpp	2013-07-31 23:54:09 UTC (rev 153546)
@@ -108,7 +108,7 @@
             return throwVMError(exec, createTypeError(exec, ASCIILiteral("Cannot supply flags when constructing one RegExp from another.")));
         regExp = asRegExpObject(arg0)->regExp();
     } else {
-        String pattern = !exec->argumentCount() ? String("") : arg0.toString(exec)->value(exec);
+        String pattern = !exec->argumentCount() ? emptyString() : arg0.toString(exec)->value(exec);
         if (exec->hadException())
             return JSValue::encode(jsUndefined());
 

Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (153545 => 153546)


--- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp	2013-07-31 23:54:09 UTC (rev 153546)
@@ -851,7 +851,7 @@
          *  replaced with the result of the _expression_ new RegExp(regexp).
          *  Per ECMA 15.10.4.1, if a0 is undefined substitute the empty string.
          */
-        regExp = RegExp::create(exec->vm(), a0.isUndefined() ? String("") : a0.toString(exec)->value(exec), NoFlags);
+        regExp = RegExp::create(exec->vm(), a0.isUndefined() ? emptyString() : a0.toString(exec)->value(exec), NoFlags);
         if (!regExp->isValid())
             return throwVMError(exec, createSyntaxError(exec, regExp->errorMessage()));
     }
@@ -902,7 +902,7 @@
          *  replaced with the result of the _expression_ new RegExp(regexp).
          *  Per ECMA 15.10.4.1, if a0 is undefined substitute the empty string.
          */
-        reg = RegExp::create(exec->vm(), a0.isUndefined() ? String("") : a0.toString(exec)->value(exec), NoFlags);
+        reg = RegExp::create(exec->vm(), a0.isUndefined() ? emptyString() : a0.toString(exec)->value(exec), NoFlags);
         if (!reg->isValid())
             return throwVMError(exec, createSyntaxError(exec, reg->errorMessage()));
     }

Modified: trunk/Source/WebCore/ChangeLog (153545 => 153546)


--- trunk/Source/WebCore/ChangeLog	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebCore/ChangeLog	2013-07-31 23:54:09 UTC (rev 153546)
@@ -1,3 +1,23 @@
+2013-07-31  Kwang Yul Seo  <[email protected]>
+
+        Use emptyString instead of String("")
+        https://bugs.webkit.org/show_bug.cgi?id=119335
+
+        Reviewed by Darin Adler.
+
+        Use emptyString() instead of String("") because it is better style and
+        faster. This is a followup to r116908, removing all occurrences of
+        String("") from WebKit.
+
+        No behavior change, no new tests needed.
+
+        * platform/graphics/blackberry/LayerAnimation.h:
+        (WebCore::LayerAnimation::name):
+        * platform/mac/PlatformEventFactoryMac.mm:
+        (WebCore::textFromEvent):
+        (WebCore::unmodifiedTextFromEvent):
+        (WebCore::keyIdentifierForKeyEvent):
+
 2013-07-31  Ruth Fong  <[email protected]>
 
         <input type=color> Mac UI behaviour

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerAnimation.h (153545 => 153546)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerAnimation.h	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerAnimation.h	2013-07-31 23:54:09 UTC (rev 153546)
@@ -59,7 +59,7 @@
     String name() const
     {
         if (m_name.isEmpty())
-            return String("");
+            return emptyString();
         return String(m_name);
     }
 

Modified: trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm (153545 => 153546)


--- trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm	2013-07-31 23:54:09 UTC (rev 153546)
@@ -232,14 +232,14 @@
 static inline String textFromEvent(NSEvent* event)
 {
     if ([event type] == NSFlagsChanged)
-        return String("");
+        return emptyString();
     return String([event characters]);
 }
 
 static inline String unmodifiedTextFromEvent(NSEvent* event)
 {
     if ([event type] == NSFlagsChanged)
-        return String("");
+        return emptyString();
     return String([event charactersIgnoringModifiers]);
 }
 
@@ -268,7 +268,7 @@
                 
             default:
                 ASSERT_NOT_REACHED();
-                return String("");
+                return emptyString();
         }
     
     NSString *s = [event charactersIgnoringModifiers];

Modified: trunk/Source/WebKit/mac/ChangeLog (153545 => 153546)


--- trunk/Source/WebKit/mac/ChangeLog	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-07-31 23:54:09 UTC (rev 153546)
@@ -1,3 +1,17 @@
+2013-07-31  Kwang Yul Seo  <[email protected]>
+
+        Use emptyString instead of String("")
+        https://bugs.webkit.org/show_bug.cgi?id=119335
+
+        Reviewed by Darin Adler.
+
+        Use emptyString() instead of String("") because it is better style and
+        faster. This is a followup to r116908, removing all occurrences of
+        String("") from WebKit.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::userAgent):
+
 2013-07-31  Ruth Fong  <[email protected]>
 
         <input type=color> Mac UI behaviour

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm (153545 => 153546)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm	2013-07-31 23:54:09 UTC (rev 153546)
@@ -1334,7 +1334,7 @@
     // Most other call sites are tolerant of nil because of Objective-C behavior, but this one
     // is not because the return value of _userAgentForURL is a const KURL&.
     if (!webView)
-        return String("");
+        return emptyString();
 
     return [webView _userAgentString];
 }

Modified: trunk/Source/WebKit/qt/ChangeLog (153545 => 153546)


--- trunk/Source/WebKit/qt/ChangeLog	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebKit/qt/ChangeLog	2013-07-31 23:54:09 UTC (rev 153546)
@@ -1,3 +1,17 @@
+2013-07-31  Kwang Yul Seo  <[email protected]>
+
+        Use emptyString instead of String("")
+        https://bugs.webkit.org/show_bug.cgi?id=119335
+
+        Reviewed by Darin Adler.
+
+        Use emptyString() instead of String("") because it is better style and
+        faster. This is a followup to r116908, removing all occurrences of
+        String("") from WebKit.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::runJavaScriptPrompt):
+
 2013-07-31  Michael BrĂ¼ning  <[email protected]>
 
         [Qt][WK1] navigator.plugins shows too few entries.

Modified: trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp (153545 => 153546)


--- trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp	2013-07-31 23:54:09 UTC (rev 153546)
@@ -357,7 +357,7 @@
     // Fix up a quirk in the QInputDialog class. If no input happened the string should be empty
     // but it is null. See https://bugs.webkit.org/show_bug.cgi?id=30914.
     if (rc && x.isNull())
-        result = String("");
+        result = emptyString();
     else
         result = x;
 

Modified: trunk/Source/WebKit2/ChangeLog (153545 => 153546)


--- trunk/Source/WebKit2/ChangeLog	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebKit2/ChangeLog	2013-07-31 23:54:09 UTC (rev 153546)
@@ -1,3 +1,18 @@
+2013-07-31  Kwang Yul Seo  <[email protected]>
+
+        Use emptyString instead of String("")
+        https://bugs.webkit.org/show_bug.cgi?id=119335
+
+        Reviewed by Darin Adler.
+
+        Use emptyString() instead of String("") because it is better style and
+        faster. This is a followup to r116908, removing all occurrences of
+        String("") from WebKit.
+
+        * Shared/mac/WebEventFactory.mm:
+        (WebKit::textFromEvent):
+        (WebKit::unmodifiedTextFromEvent):
+
 2013-07-31  Ruth Fong  <[email protected]>
 
         <input type=color> Mac UI behaviour

Modified: trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm (153545 => 153546)


--- trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm	2013-07-31 23:21:59 UTC (rev 153545)
+++ trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm	2013-07-31 23:54:09 UTC (rev 153546)
@@ -255,14 +255,14 @@
 static inline String textFromEvent(NSEvent* event)
 {
     if ([event type] == NSFlagsChanged)
-        return String("");
+        return emptyString();
     return String([event characters]);
 }
 
 static inline String unmodifiedTextFromEvent(NSEvent* event)
 {
     if ([event type] == NSFlagsChanged)
-        return String("");
+        return emptyString();
     return String([event charactersIgnoringModifiers]);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to