Web Inspector: Upgrade Esprima to the latest one to support dynamic import
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2017 10:31:18 +0000 (10:31 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2017 10:31:18 +0000 (10:31 +0000)
commit56b593446c0ee066845df8fc58e8163c37fbf596
treeb98cd2be39445366dafd3d95fc31ca863a8c841f
parentd93a90feaf025c1a4e762a4e369f2d5d7a1d8463
Web Inspector: Upgrade Esprima to the latest one to support dynamic import
https://bugs.webkit.org/show_bug.cgi?id=167698

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/External/Esprima/esprima.js:
Update to Esprima@5307e30 (4.0.0-dev).

* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration.gatherIdentifiers):
(WebInspector.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration):
(WebInspector.ScriptSyntaxTree.prototype._recurse):
(WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
(WebInspector.ScriptSyntaxTree):
* UserInterface/Workers/Formatter/ESTreeWalker.js:
(ESTreeWalker.prototype._walkChildren):
(ESTreeWalker):
Add new nodes, SpreadProperty, RestProperty, and Import.
SpreadProperty and RestProperty are the part of ES2018 rest and spread properties.
https://github.com/sebmarkbage/ecmascript-rest-spread
Import is dynamic import node. The syntax is similar to Super.
https://github.com/tc39/proposal-dynamic-import

* UserInterface/Workers/Formatter/EsprimaFormatter.js:
(EsprimaFormatter.prototype._handleTokenAtNode):

LayoutTests:

* inspector/formatting/formatting-javascript-expected.txt:
* inspector/formatting/formatting-javascript.html:
* inspector/formatting/resources/javascript-tests/import-expected.js: Added.
(async.load):
* inspector/formatting/resources/javascript-tests/import.js: Added.
(async.load):
* inspector/formatting/resources/javascript-tests/object-array-literal-expected.js:
* inspector/formatting/resources/javascript-tests/object-array-literal.js:
* inspector/formatting/resources/javascript-tests/variable-declaration-expected.js:
* inspector/formatting/resources/javascript-tests/variable-declaration.js:
* inspector/formatting/resources/utilities.js:
(TestPage.registerInitializer.):
(TestPage.registerInitializer):
Fix a bug which occurs when output is not expected one.

* inspector/model/parse-script-syntax-tree-expected.txt:
* inspector/model/parse-script-syntax-tree.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/inspector/formatting/formatting-javascript-expected.txt
LayoutTests/inspector/formatting/formatting-javascript.html
LayoutTests/inspector/formatting/resources/javascript-tests/import-expected.js [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/javascript-tests/import.js [new file with mode: 0644]
LayoutTests/inspector/formatting/resources/javascript-tests/object-array-literal-expected.js
LayoutTests/inspector/formatting/resources/javascript-tests/object-array-literal.js
LayoutTests/inspector/formatting/resources/javascript-tests/variable-declaration-expected.js
LayoutTests/inspector/formatting/resources/javascript-tests/variable-declaration.js
LayoutTests/inspector/formatting/resources/utilities.js
LayoutTests/inspector/model/parse-script-syntax-tree-expected.txt
LayoutTests/inspector/model/parse-script-syntax-tree.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Tools/Formatting/index.html
Source/WebInspectorUI/UserInterface/External/Esprima/esprima.js
Source/WebInspectorUI/UserInterface/Models/ScriptSyntaxTree.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/ESTreeWalker.js
Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js