2011-02-04 Mikhail Naganov <mnaganov@chromium.org>
authormnaganov@chromium.org <mnaganov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 18:27:06 +0000 (18:27 +0000)
committermnaganov@chromium.org <mnaganov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 18:27:06 +0000 (18:27 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: fix processing Unicode literals from .js sources in check-inspector-strings.
        https://bugs.webkit.org/show_bug.cgi?id=53781

        * Scripts/check-inspector-strings:

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

Tools/ChangeLog
Tools/Scripts/check-inspector-strings

index 5ac9ab81525fcefe767cff74b52b1f24def685d8..41bbcbc3797f9dae0fe2ff294b1f071616d1bae1 100644 (file)
@@ -1,3 +1,12 @@
+2011-02-04  Mikhail Naganov  <mnaganov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: fix processing Unicode literals from .js sources in check-inspector-strings.
+        https://bugs.webkit.org/show_bug.cgi?id=53781
+
+        * Scripts/check-inspector-strings:
+
 2011-02-04  Adam Roben  <aroben@apple.com>
 
         Include the crashing function in the link to a crash log on Mac
index c95afcbf0b0711b1590303cd2f27d6bede13b5f3..0350acad0de35a70dd4293b17ade8b6ad4ca663c 100755 (executable)
@@ -54,6 +54,9 @@ class StringsExtractor(ProcessorBase):
     def should_process(self, file_path):
         return file_path.endswith(".js") and (not file_path.endswith("InjectedScript.js"))
 
+    def decode_unicode_escapes(self, s):
+        return eval("ur\"" + s + "\"")
+
     def process(self, lines, file_path, line_numbers=None):
         for line in lines:
             comment_start = line.find("//")
@@ -63,7 +66,7 @@ class StringsExtractor(ProcessorBase):
             for pattern in self._patterns:
                 line_strings = re.findall(pattern, line)
                 for string in line_strings:
-                    self.strings[index].append(string)
+                    self.strings[index].append(self.decode_unicode_escapes(string))
                 index += 1
 
 class LocalizedStringsExtractor: