Bug 135098 (esprima) - Web Inspector: Add esprima to the WebInspector.
Summary: Web Inspector: Add esprima to the WebInspector.
Status: RESOLVED FIXED
Alias: esprima
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-19 15:10 PDT by Saam Barati
Modified: 2014-07-21 19:36 PDT (History)
7 users (show)

See Also:


Attachments
patch (123.71 KB, patch)
2014-07-19 15:19 PDT, Saam Barati
joepeck: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff
patch (124.21 KB, patch)
2014-07-21 12:22 PDT, Saam Barati
joepeck: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff
patch (124.09 KB, patch)
2014-07-21 16:28 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2014-07-19 15:10:17 PDT
Add the AST library Esprima to the WebInspector so that we can parse JavaScript into an AST.
(More information on Esprima at: http://esprima.org)
Comment 1 Radar WebKit Bug Importer 2014-07-19 15:10:39 PDT
<rdar://problem/17739150>
Comment 2 Saam Barati 2014-07-19 15:19:34 PDT
Created attachment 235176 [details]
patch

This patch includes Esprima into the WebInspector and attaches its exported function onto the WebInspector namespace object.
Comment 3 Joseph Pecoraro 2014-07-21 10:58:42 PDT
Comment on attachment 235176 [details]
patch

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

> Source/WebInspectorUI/ChangeLog:11
> +        * UserInterface/External/esprima.js: Added.

Lets make a subfolder for this, like other External libraries.

    UserInterface/External/Esprima/esprima.js

> Source/WebInspectorUI/UserInterface/External/esprima.js:1
> +/*

We will want to minify this script in production builds. See how this script handles CodeMirror:

    Source/WebInspectorUI/Scripts/copy-user-interface-resources.pl

This could be done in a follow-up.

> Source/WebInspectorUI/UserInterface/External/esprima.js:34
> +WebInspector._esprima = {};

You should mention the edits you've made in a comment in this file. I suspect this, and its use below, are the only changes you made.
Comment 4 Saam Barati 2014-07-21 12:22:39 PDT
Created attachment 235238 [details]
patch

This patch includes Esprima into the WebInspector and attaches its exported function onto the WebInspector namespace object.

(Will modify the minifying pearl script in another patch).
Comment 5 Joseph Pecoraro 2014-07-21 13:37:07 PDT
Comment on attachment 235238 [details]
patch

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

> Source/WebInspectorUI/UserInterface/External/Esprima/esprima.js:35
> +// I delted the code that determines the context esprima is loaded in (node.js, the browser, etc.) and replaced it with WebInspector._esprima.

We should not have "I" in a comment. Someone reading this will not know who that refers too, and any one individual does not necessary own a file. This is more of a "we" meaning the project / contributors as a whole.

Something like this would be sufficient:

  // WebKit Modifications:
  //   - replaced code that automatically determines Esprima execution context (node, browser, etc.) with WebInspector._esprima

The idea here is to make it easier for the next person who updates Esprima by documenting the changes we've made.
Comment 6 Saam Barati 2014-07-21 16:28:35 PDT
Created attachment 235252 [details]
patch

This patch includes Esprima into the WebInspector and attaches its exported function onto the WebInspector namespace object.

(Comment modifications taken into account).
Comment 7 Joseph Pecoraro 2014-07-21 19:04:42 PDT
Comment on attachment 235252 [details]
patch

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

> Source/WebInspectorUI/ChangeLog:13
> +        (.):

Nit: prepare-ChangeLog left a turd. In the future you can remove these.
Comment 8 WebKit Commit Bot 2014-07-21 19:36:55 PDT
Comment on attachment 235252 [details]
patch

Clearing flags on attachment: 235252

Committed r171334: <http://trac.webkit.org/changeset/171334>
Comment 9 WebKit Commit Bot 2014-07-21 19:36:59 PDT
All reviewed patches have been landed.  Closing bug.