[tools] testbot/cgi: Standardize the case of JsQuote().

Francois Gouget fgouget at codeweavers.com
Wed Jun 8 09:40:34 CDT 2022


This better matches the TestBot's naming standard, particularly
ShQuote() and BatchQuote().

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
The lowercase prefix came from the nearby escapeHTML() method which
should probably be renamed too. But it is used in more places and maybe
it should also not be a method. So that change can wait.
One could also argue that because JavaScript has two uppercase letters
it should really be JSQuote(). But that would again make it somewhat
unique.
---
 testbot/lib/ObjectModel/CGI/Page.pm     | 4 ++--
 testbot/lib/WineTestBot/CGI/PageBase.pm | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/Page.pm b/testbot/lib/ObjectModel/CGI/Page.pm
index 406ca4ff8..1b9630cc2 100644
--- a/testbot/lib/ObjectModel/CGI/Page.pm
+++ b/testbot/lib/ObjectModel/CGI/Page.pm
@@ -142,14 +142,14 @@ sub escapeHTML($$)
 =pod
 =over 12
 
-=head1 C<jsQuote()>
+=head1 C<JsQuote()>
 
 Quotes a string for JavaScript code.
 
 =back
 =cut
 
-sub jsQuote($$)
+sub JsQuote($$)
 {
   my ($self, $String) = @_;
 
diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm
index d68b97289..d6f33e2ca 100644
--- a/testbot/lib/WineTestBot/CGI/PageBase.pm
+++ b/testbot/lib/WineTestBot/CGI/PageBase.pm
@@ -374,7 +374,7 @@ sub GenerateErrorPopup($$)
   {
     print "<script type='text/javascript'>\n";
     print "<!--\n";
-    print "function ShowError() { alert(", $Page->jsQuote($ErrMessage), "); }\n";
+    print "function ShowError() { alert(", $Page->JsQuote($ErrMessage), "); }\n";
     my $ErrField = $Page->GetErrField();
     if ($ErrField)
     {
-- 
2.30.2




More information about the wine-devel mailing list