Bug 198691

Summary: Web Inspector: "Copy Path to Property" doesn't work with multiline keys
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: commit-queue, inspector-bugzilla-changes, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Screenshot of the issue
none
Patch none

Description Alexey Shvayka 2019-06-08 12:54:43 PDT
Created attachment 371664 [details]
Screenshot of the issue

Steps to reproduce:
1. Inspect `[{a: {b: {"\n": 1}}}]` and expand down to object `b`.
2. Right-click on "\n" property, "Copy Path to Property".
3. Paste from clipboard, you get:

```
$1[0].a.b["
"]
```

Which is not valid and causes SyntaxError when executing.
Comment 1 Alexey Shvayka 2019-06-08 14:48:22 PDT
Created attachment 371668 [details]
Patch
Comment 2 Matt Baker 2019-06-10 11:50:07 PDT
FYI, Chrome devtools shows: `b: {"↵": 1}` in the console.
Comment 3 Matt Baker 2019-06-10 12:02:10 PDT
Comment on attachment 371668 [details]
Patch

r=me, nice catch.
Comment 4 WebKit Commit Bot 2019-06-10 12:32:06 PDT
Comment on attachment 371668 [details]
Patch

Clearing flags on attachment: 371668

Committed r246271: <https://trac.webkit.org/changeset/246271>
Comment 5 WebKit Commit Bot 2019-06-10 12:32:07 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-06-10 12:33:18 PDT
<rdar://problem/51592479>