Changeset 246271 in webkit


Ignore:
Timestamp:
Jun 10, 2019 12:32:00 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: "Copy Path to Property" doesn't work with multiline keys
https://bugs.webkit.org/show_bug.cgi?id=198691

Patch by Alexey Shvayka <Alexey Shvayka> on 2019-06-10
Reviewed by Matt Baker.

Correctly escape line terminators to prevent doubleQuotedString from returning malformed strings.

  • UserInterface/Base/Utilities.js: Use JSON.stringify.
Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r246268 r246271  
     12019-06-10  Alexey Shvayka  <shvaikalesh@gmail.com>
     2
     3        Web Inspector: "Copy Path to Property" doesn't work with multiline keys
     4        https://bugs.webkit.org/show_bug.cgi?id=198691
     5
     6        Reviewed by Matt Baker.
     7
     8        Correctly escape line terminators to prevent doubleQuotedString from returning malformed strings.
     9
     10        * UserInterface/Base/Utilities.js: Use JSON.stringify.
     11
    1122019-06-10  Devin Rousso  <drousso@apple.com>
    213
  • trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js

    r246026 r246271  
    16381638function doubleQuotedString(str)
    16391639{
    1640     return "\"" + str.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"";
     1640    return JSON.stringify(str);
    16411641}
    16421642
Note: See TracChangeset for help on using the changeset viewer.