Title: [253490] trunk/Tools
Revision
253490
Author
[email protected]
Date
2019-12-13 11:31:17 -0800 (Fri, 13 Dec 2019)

Log Message

Teach prepare-ChangeLog about _javascript_ async functions
https://bugs.webkit.org/show_bug.cgi?id=205195

Reviewed by Jonathan Bedard.

* Scripts/prepare-ChangeLog:
(get_function_line_ranges_for_javascript):

* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests.js:
(AsyncFuncClass): Added.
(AsyncFuncClass.async staticAsync): Added.
(AsyncFuncClass.prototype.async methodAsync): Added.
(AsyncFuncClass.prototype.async get getAsync): Added.
(AsyncFuncClass.prototype.async set setAsync): Added.
(async asyncFunc1): Added.
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests-expected.txt:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (253489 => 253490)


--- trunk/Tools/ChangeLog	2019-12-13 19:18:37 UTC (rev 253489)
+++ trunk/Tools/ChangeLog	2019-12-13 19:31:17 UTC (rev 253490)
@@ -1,3 +1,22 @@
+2019-12-13  Devin Rousso  <[email protected]>
+
+        Teach prepare-ChangeLog about _javascript_ async functions
+        https://bugs.webkit.org/show_bug.cgi?id=205195
+
+        Reviewed by Jonathan Bedard.
+
+        * Scripts/prepare-ChangeLog:
+        (get_function_line_ranges_for_javascript):
+
+        * Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests.js:
+        (AsyncFuncClass): Added.
+        (AsyncFuncClass.async staticAsync): Added.
+        (AsyncFuncClass.prototype.async methodAsync): Added.
+        (AsyncFuncClass.prototype.async get getAsync): Added.
+        (AsyncFuncClass.prototype.async set setAsync): Added.
+        (async asyncFunc1): Added.
+        * Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests-expected.txt:
+
 2019-12-13  John Wilander  <[email protected]>
 
         IsLoggedIn: Abstract data type for IsLoggedIn state

Modified: trunk/Tools/Scripts/prepare-ChangeLog (253489 => 253490)


--- trunk/Tools/Scripts/prepare-ChangeLog	2019-12-13 19:18:37 UTC (rev 253489)
+++ trunk/Tools/Scripts/prepare-ChangeLog	2019-12-13 19:31:17 UTC (rev 253490)
@@ -1474,6 +1474,7 @@
     my $functionJustSeen = 0;
     my $getterJustSeen = 0;
     my $setterJustSeen = 0;
+    my $asyncJustSeen = 0;
     my $assignmentJustSeen = 0;
     my $staticOrContructorSeen = 0;
 
@@ -1659,6 +1660,13 @@
                 next;
             }
 
+            # Async prefix.
+            if ($1 eq 'async') {
+                next if $lastToken eq '.';
+                $asyncJustSeen = 1;
+                next;
+            }
+
             # Static.
             if ($1 eq 'static' or $1 eq 'constructor') {
                 $staticOrContructorSeen = 1;
@@ -1686,14 +1694,15 @@
                 push(@currentFunctionNames, $currentClass);
                 push(@currentFunctionDepths, $bracesDepth);
                 push(@currentFunctionStartLines, $.);
-            } elsif ($getterJustSeen or $setterJustSeen) {
+            } elsif ($getterJustSeen or $setterJustSeen or $asyncJustSeen) {
                 $word = "get $word" if $getterJustSeen;
                 $word = "set $word" if $setterJustSeen;
+                $word = "async $word" if $asyncJustSeen;
 
                 push(@currentIdentifiers, $word);
 
                 my $mode = $currentParsingMode[$#currentParsingMode];
-                my $currentFunction = join('.', (@currentScopes, ($mode eq 'class') ? "prototype" : "", @currentIdentifiers));
+                my $currentFunction = join('.', (@currentScopes, ($mode eq 'class' and !$staticOrContructorSeen) ? "prototype" : "", @currentIdentifiers));
                 $currentFunction =~ s/\.{2,}/\./g; # Removes consecutive periods.
 
                 push(@currentParsingMode, "function");
@@ -1719,6 +1728,7 @@
             $functionJustSeen = 0;
             $getterJustSeen = 0;
             $setterJustSeen = 0;
+            $asyncJustSeen = 0;
             $assignmentJustSeen = 0;
         }
     }

Modified: trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests-expected.txt (253489 => 253490)


--- trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests-expected.txt	2019-12-13 19:18:37 UTC (rev 253489)
+++ trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests-expected.txt	2019-12-13 19:31:17 UTC (rev 253490)
@@ -261,6 +261,36 @@
       '222',
       '239',
       'IssueWithMapGetAndSet'
+    ],
+    [
+      242,
+      244,
+      'AsyncFuncClass.async staticAsync'
+    ],
+    [
+      246,
+      248,
+      'AsyncFuncClass.prototype.async methodAsync'
+    ],
+    [
+      250,
+      252,
+      'AsyncFuncClass.prototype.async get getAsync'
+    ],
+    [
+      254,
+      256,
+      'AsyncFuncClass.prototype.async set setAsync'
+    ],
+    [
+      241,
+      257,
+      'AsyncFuncClass'
+    ],
+    [
+      259,
+      261,
+      'async asyncFunc1'
     ]
   ]
 }

Modified: trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests.js (253489 => 253490)


--- trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests.js	2019-12-13 19:18:37 UTC (rev 253489)
+++ trunk/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/_javascript__unittests.js	2019-12-13 19:31:17 UTC (rev 253490)
@@ -237,3 +237,25 @@
     {
     }
 };
+
+class AsyncFuncClass {
+    static async staticAsync()
+    {
+    }
+
+    async methodAsync()
+    {
+    }
+
+    async get getAsync()
+    {
+    }
+
+    async set setAsync()
+    {
+    }
+};
+
+async function asyncFunc1()
+{
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to