Bug 161891 - Web Inspector: Should be able to pretty print module code (import / export statements)
Summary: Web Inspector: Should be able to pretty print module code (import / export st...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-09-12 20:43 PDT by Joseph Pecoraro
Modified: 2016-09-29 11:34 PDT (History)
8 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (24.42 KB, patch)
2016-09-12 20:50 PDT, Joseph Pecoraro
ysuzuki: review+
Details | Formatted Diff | Diff
[PATCH] For Landing (24.45 KB, patch)
2016-09-13 11:25 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-09-12 20:43:51 PDT
Summary:
Should be able to pretty print module code (import / export statements).

In preparation for module tags. The pretty printer should be able to handle import / export statements.

Notes
- Esprima has two different parse modes. "script" or "module" based on the "sourceType" option.
- The Formatting tool should be updated to test this.
Comment 1 Radar WebKit Bug Importer 2016-09-12 20:44:08 PDT
<rdar://problem/28272784>
Comment 2 Joseph Pecoraro 2016-09-12 20:50:32 PDT
Created attachment 288666 [details]
[PATCH] Proposed Fix
Comment 3 Yusuke Suzuki 2016-09-12 21:25:30 PDT
Comment on attachment 288666 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=288666&action=review

Nice! r=me.

> LayoutTests/inspector/formatting/resources/javascript-tests/modules-expected.js:19
> +    y = 1;

We can perform destructuring here :)
`export let { x, y, z } = obj`
`export let [x, y, z ] = array`
Comment 4 Joseph Pecoraro 2016-09-13 11:25:20 PDT
Created attachment 288706 [details]
[PATCH] For Landing
Comment 5 WebKit Commit Bot 2016-09-13 11:39:18 PDT
Comment on attachment 288706 [details]
[PATCH] For Landing

Clearing flags on attachment: 288706

Committed r205866: <http://trac.webkit.org/changeset/205866>