Diff
Modified: trunk/LayoutTests/ChangeLog (199837 => 199838)
--- trunk/LayoutTests/ChangeLog 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/LayoutTests/ChangeLog 2016-04-21 22:24:17 UTC (rev 199838)
@@ -1,3 +1,16 @@
+2016-04-21 Joseph Pecoraro <pecor...@apple.com>
+
+ Web Inspector: Debugger statement gets a space after it when pretty printed
+ https://bugs.webkit.org/show_bug.cgi?id=156867
+ <rdar://problem/25862308>
+
+ Reviewed by Geoffrey Garen.
+
+ * inspector/formatting/formatting-_javascript_-expected.txt:
+ * inspector/formatting/formatting-_javascript_.html:
+ * inspector/formatting/resources/_javascript_-tests/other-statements-expected.js: Renamed from LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement-expected.js.
+ * inspector/formatting/resources/_javascript_-tests/other-statements.js: Renamed from LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement.js.
+
2016-04-21 Brady Eidson <beid...@apple.com>
Modern IDB (Workers): More IDBConnectionProxy refactoring.
Modified: trunk/LayoutTests/inspector/formatting/formatting-_javascript_-expected.txt (199837 => 199838)
--- trunk/LayoutTests/inspector/formatting/formatting-_javascript_-expected.txt 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/LayoutTests/inspector/formatting/formatting-_javascript_-expected.txt 2016-04-21 22:24:17 UTC (rev 199838)
@@ -41,6 +41,9 @@
-- Running test case: EsprimaFormatter._javascript_.object-array-literal.js
PASS
+-- Running test case: EsprimaFormatter._javascript_.other-statements.js
+PASS
+
-- Running test case: EsprimaFormatter._javascript_.return-statement.js
PASS
@@ -62,9 +65,6 @@
-- Running test case: EsprimaFormatter._javascript_.ternary-expressions.js
PASS
--- Running test case: EsprimaFormatter._javascript_.throw-statement.js
-PASS
-
-- Running test case: EsprimaFormatter._javascript_.try-catch-finally-statements.js
PASS
Modified: trunk/LayoutTests/inspector/formatting/formatting-_javascript_.html (199837 => 199838)
--- trunk/LayoutTests/inspector/formatting/formatting-_javascript_.html 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/LayoutTests/inspector/formatting/formatting-_javascript_.html 2016-04-21 22:24:17 UTC (rev 199838)
@@ -22,6 +22,7 @@
"resources/_javascript_-tests/logic-expressions.js",
"resources/_javascript_-tests/new-_expression_.js",
"resources/_javascript_-tests/object-array-literal.js",
+ "resources/_javascript_-tests/other-statements.js",
"resources/_javascript_-tests/return-statement.js",
"resources/_javascript_-tests/sample-jquery.js",
"resources/_javascript_-tests/sample-normal-utilities.js",
@@ -29,7 +30,6 @@
"resources/_javascript_-tests/switch-case-default.js",
"resources/_javascript_-tests/template-strings.js",
"resources/_javascript_-tests/ternary-expressions.js",
- "resources/_javascript_-tests/throw-statement.js",
"resources/_javascript_-tests/try-catch-finally-statements.js",
"resources/_javascript_-tests/unary-binary-expressions.js",
"resources/_javascript_-tests/variable-declaration.js",
Copied: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/other-statements-expected.js (from rev 199837, trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement-expected.js) (0 => 199838)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/other-statements-expected.js (rev 0)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/other-statements-expected.js 2016-04-21 22:24:17 UTC (rev 199838)
@@ -0,0 +1,12 @@
+throw 1;
+throw x;
+throw [];
+throw (1);
+throw "x";
+throw new x;
+throw {
+ a: 1
+};
+
+debugger
+debugger;
Copied: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/other-statements.js (from rev 199837, trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement.js) (0 => 199838)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/other-statements.js (rev 0)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/other-statements.js 2016-04-21 22:24:17 UTC (rev 199838)
@@ -0,0 +1,10 @@
+throw 1;
+throw x;
+throw[];
+throw(1);
+throw"x";
+throw new x;
+throw {a:1};
+
+debugger
+debugger;
Deleted: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement-expected.js (199837 => 199838)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement-expected.js 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement-expected.js 2016-04-21 22:24:17 UTC (rev 199838)
@@ -1,9 +0,0 @@
-throw 1;
-throw x;
-throw [];
-throw (1);
-throw "x";
-throw new x;
-throw {
- a: 1
-};
Deleted: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement.js (199837 => 199838)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement.js 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/throw-statement.js 2016-04-21 22:24:17 UTC (rev 199838)
@@ -1,7 +0,0 @@
-throw 1;
-throw x;
-throw[];
-throw(1);
-throw"x";
-throw new x;
-throw {a:1};
Modified: trunk/Source/WebInspectorUI/ChangeLog (199837 => 199838)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-04-21 22:24:17 UTC (rev 199838)
@@ -1,3 +1,16 @@
+2016-04-21 Joseph Pecoraro <pecor...@apple.com>
+
+ Web Inspector: Debugger statement gets a space after it when pretty printed
+ https://bugs.webkit.org/show_bug.cgi?id=156867
+ <rdar://problem/25862308>
+
+ Reviewed by Geoffrey Garen.
+
+ * Tools/Formatting/index.html:
+ * UserInterface/Workers/Formatter/EsprimaFormatter.js:
+ (EsprimaFormatter.prototype._handleTokenAtNode):
+ Handle the unhandled DebuggerStatement node type.
+
2016-04-20 Joseph Pecoraro <pecor...@apple.com>
Web Inspector: console.table(navigator) throws exception about `rowPreview.propertyPreviews.length`
Modified: trunk/Source/WebInspectorUI/Tools/Formatting/index.html (199837 => 199838)
--- trunk/Source/WebInspectorUI/Tools/Formatting/index.html 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/Source/WebInspectorUI/Tools/Formatting/index.html 2016-04-21 22:24:17 UTC (rev 199838)
@@ -52,8 +52,8 @@
"new-_expression_.js",
"label-break-continue-block.js",
"with-statement.js",
- "throw-statement.js",
"return-statement.js",
+ "other-statements.js",
"variable-declaration.js",
"functions.js",
"classes.js",
Modified: trunk/Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js (199837 => 199838)
--- trunk/Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js 2016-04-21 22:11:38 UTC (rev 199837)
+++ trunk/Source/WebInspectorUI/UserInterface/Workers/Formatter/EsprimaFormatter.js 2016-04-21 22:24:17 UTC (rev 199838)
@@ -785,7 +785,8 @@
|| nodeType === "MetaProperty"
|| nodeType === "RestElement"
|| nodeType === "TemplateElement"
- || nodeType === "TemplateLiteral") {
+ || nodeType === "TemplateLiteral"
+ || nodeType === "DebuggerStatement") {
builder.appendToken(tokenValue, tokenOffset);
return;
}