Diff
Modified: trunk/LayoutTests/ChangeLog (260519 => 260520)
--- trunk/LayoutTests/ChangeLog 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/ChangeLog 2020-04-22 17:24:14 UTC (rev 260520)
@@ -1,3 +1,35 @@
+2020-04-22 Devin Rousso <[email protected]>
+
+ Web Inspector: Debugger: Step Over should only step through comma expressions if they are comma statements
+ https://bugs.webkit.org/show_bug.cgi?id=210588
+
+ Reviewed by Brian Burg.
+
+ * inspector/debugger/resources/log-pause-location.js:
+ (TestPage.registerInitializer.window.step):
+ * inspector/debugger/breakpoints/resources/dump-functions.js:
+ * inspector/debugger/breakpoints/resources/dump-general.js:
+ * inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt:
+ * inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt:
+ * inspector/debugger/stepping/stepInto.html:
+ * inspector/debugger/stepping/stepInto-expected.txt:
+ * inspector/debugger/stepping/stepNext.html:
+ * inspector/debugger/stepping/stepNext-expected.txt:
+ * inspector/debugger/stepping/stepOut.html:
+ * inspector/debugger/stepping/stepOut-expected.txt:
+ * inspector/debugger/stepping/stepOver.html:
+ * inspector/debugger/stepping/stepOver-expected.txt:
+ * inspector/debugger/stepping/stepping-control-flow.html:
+ * inspector/debugger/stepping/stepping-control-flow-expected.txt:
+ * inspector/debugger/stepping/stepping-loops.html:
+ * inspector/debugger/stepping/stepping-loops-expected.txt:
+ * inspector/formatting/resources/_javascript_-tests/arrow-functions.js:
+ * inspector/formatting/resources/_javascript_-tests/arrow-functions-expected.js:
+ * inspector/formatting/resources/_javascript_-tests/functions.js:
+ * inspector/formatting/resources/_javascript_-tests/functions-expected.js:
+ * inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements.js:
+ * inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements-expected.js:
+
2020-04-22 Antoine Quint <[email protected]>
[ Mojave wk1 Release ] animations/transition-and-animation-1.html is a flaky failure
Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -1411,7 +1411,7 @@
=> 214 |b(),
215 c();
216
- 217 true && (a(), b(), c());
+ 217 true && (a(), b(), c()) && true;
INSERTING AT: 214:1
PAUSES AT: 215:0
@@ -1421,7 +1421,7 @@
-> 214 b#(),
=> 215 |c();
216
- 217 true && (a(), b(), c());
+ 217 true && (a(), b(), c()) && true;
218
INSERTING AT: 215:1
@@ -1431,34 +1431,116 @@
214 b(),
-> 215 c#();
216
- => 217 |true && (a(), b(), c());
+ => 217 |true && (a(), b(), c()) && true;
218
+ 219 true && (
+ 220 a(),
INSERTING AT: 217:1
-PAUSES AT: 217:9
+PAUSES AT: 219:0
214 b(),
215 c();
216
--=> 217 t#rue && (|a(), b(), c());
+ -> 217 t#rue && (a(), b(), c()) && true;
218
+ => 219 |true && (
+ 220 a(),
+ 221 b(),
+ 222 c()
-INSERTING AT: 217:10
-PAUSES AT: 217:14
- 214 b(),
- 215 c();
+INSERTING AT: 219:1
+PAUSES AT: 226:4
216
--=> 217 true && (a#(), |b(), c());
+ 217 true && (a(), b(), c()) && true;
218
+ -> 219 t#rue && (
+ 220 a(),
+ 221 b(),
+ 222 c()
+ 223 ) && true;
+ 224
+ 225 try {
+ => 226 |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
-INSERTING AT: 217:15
-PAUSES AT: 217:19
- 214 b(),
- 215 c();
- 216
--=> 217 true && (a(), b#(), |c());
- 218
+INSERTING AT: 226:5
+PAUSES AT: 226:10
+ 223 ) && true;
+ 224
+ 225 try {
+-=> 226 t#hrow |a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+INSERTING AT: 226:11
+PAUSES AT: 226:15
+ 223 ) && true;
+ 224
+ 225 try {
+-=> 226 throw a#(), |b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+INSERTING AT: 226:16
+PAUSES AT: 226:20
+ 223 ) && true;
+ 224
+ 225 try {
+-=> 226 throw a(), b#(), |c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+INSERTING AT: 226:21
+PAUSES AT: 230:4
+ 223 ) && true;
+ 224
+ 225 try {
+ -> 226 throw a(), b(), c#();
+ 227 } catch { }
+ 228
+ 229 try {
+ => 230 |throw a(),
+ 231 b(),
+ 232 c();
+ 233 } catch { }
+
+INSERTING AT: 230:5
+PAUSES AT: 230:10
+ 227 } catch { }
+ 228
+ 229 try {
+-=> 230 t#hrow |a(),
+ 231 b(),
+ 232 c();
+ 233 } catch { }
+
+INSERTING AT: 230:11
+PAUSES AT: 231:8
+ 227 } catch { }
+ 228
+ 229 try {
+ -> 230 throw a#(),
+ => 231 |b(),
+ 232 c();
+ 233 } catch { }
+ 234
+
+INSERTING AT: 231:9
+PAUSES AT: 232:8
+ 228
+ 229 try {
+ 230 throw a(),
+ -> 231 b#(),
+ => 232 |c();
+ 233 } catch { }
+ 234
+
+
-- Running test case: Debugger.resolvedBreakpoint.dumpAllLocations.Functions
INSERTING AT: 0:0
@@ -2574,6 +2656,7 @@
=> 122 |inline();
123 }
124
+ 125 function returnOneLine() {
INSERTING AT: 122:5
PAUSES AT: 123:0
@@ -2583,8 +2666,113 @@
-> 122 i#nline();
=> 123 |}
124
+ 125 function returnOneLine() {
+ 126 return inline(), inline(), inline();
+INSERTING AT: 125:0
+PAUSES AT: 126:4
+ 122 inline();
+ 123 }
+ 124
+ -> 125 #function returnOneLine() {
+ => 126 |return inline(), inline(), inline();
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+INSERTING AT: 126:5
+PAUSES AT: 126:11
+ 123 }
+ 124
+ 125 function returnOneLine() {
+-=> 126 r#eturn |inline(), inline(), inline();
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+
+INSERTING AT: 126:12
+PAUSES AT: 126:21
+ 123 }
+ 124
+ 125 function returnOneLine() {
+-=> 126 return i#nline(), |inline(), inline();
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+
+INSERTING AT: 126:22
+PAUSES AT: 126:31
+ 123 }
+ 124
+ 125 function returnOneLine() {
+-=> 126 return inline(), i#nline(), |inline();
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+
+INSERTING AT: 126:32
+PAUSES AT: 127:0
+ 123 }
+ 124
+ 125 function returnOneLine() {
+ -> 126 return inline(), inline(), i#nline();
+ => 127 |}
+ 128
+ 129 function returnMultiLine() {
+ 130 return inline(),
+
+INSERTING AT: 129:0
+PAUSES AT: 130:4
+ 126 return inline(), inline(), inline();
+ 127 }
+ 128
+ -> 129 #function returnMultiLine() {
+ => 130 |return inline(),
+ 131 inline(),
+ 132 inline();
+ 133 }
+
+INSERTING AT: 130:5
+PAUSES AT: 130:11
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+-=> 130 r#eturn |inline(),
+ 131 inline(),
+ 132 inline();
+ 133 }
+
+INSERTING AT: 130:12
+PAUSES AT: 131:8
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+ -> 130 return i#nline(),
+ => 131 |inline(),
+ 132 inline();
+ 133 }
+ 134
+
+INSERTING AT: 131:9
+PAUSES AT: 132:8
+ 128
+ 129 function returnMultiLine() {
+ 130 return inline(),
+ -> 131 i#nline(),
+ => 132 |inline();
+ 133 }
+ 134
+
+INSERTING AT: 132:9
+PAUSES AT: 133:0
+ 129 function returnMultiLine() {
+ 130 return inline(),
+ 131 inline(),
+ -> 132 i#nline();
+ => 133 |}
+ 134
+
+
-- Running test case: Debugger.resolvedBreakpoint.dumpAllLocations.Unicode
INSERTING AT: 0:0
Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -3093,7 +3093,7 @@
-=> 214 |b(),
215 c();
216
- 217 true && (a(), b(), c());
+ 217 true && (a(), b(), c()) && true;
INSERTING AT: 215:0
@@ -3103,7 +3103,7 @@
214 b(),
-=> 215 |c();
216
- 217 true && (a(), b(), c());
+ 217 true && (a(), b(), c()) && true;
218
@@ -3113,8 +3113,10 @@
214 b(),
215 c();
-> 216 #
- => 217 |true && (a(), b(), c());
+ => 217 |true && (a(), b(), c()) && true;
218
+ 219 true && (
+ 220 a(),
INSERTING AT: 217:0
@@ -3122,13 +3124,210 @@
214 b(),
215 c();
216
--=> 217 |true && (a(), b(), c());
+-=> 217 |true && (a(), b(), c()) && true;
218
+ 219 true && (
+ 220 a(),
INSERTING AT: 218:0
+PAUSES AT: 219:0
+ 215 c();
+ 216
+ 217 true && (a(), b(), c()) && true;
+ -> 218 #
+ => 219 |true && (
+ 220 a(),
+ 221 b(),
+ 222 c()
+
+
+INSERTING AT: 219:0
+PAUSES AT: 219:0
+ 216
+ 217 true && (a(), b(), c()) && true;
+ 218
+-=> 219 |true && (
+ 220 a(),
+ 221 b(),
+ 222 c()
+
+
+INSERTING AT: 220:0
+PAUSES AT: 226:4
+ 217 true && (a(), b(), c()) && true;
+ 218
+ 219 true && (
+ -> 220 # a(),
+ 221 b(),
+ 222 c()
+ 223 ) && true;
+ 224
+ 225 try {
+ => 226 |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+
+INSERTING AT: 221:0
+PAUSES AT: 226:4
+ 218
+ 219 true && (
+ 220 a(),
+ -> 221 # b(),
+ 222 c()
+ 223 ) && true;
+ 224
+ 225 try {
+ => 226 |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+
+INSERTING AT: 222:0
+PAUSES AT: 226:4
+ 219 true && (
+ 220 a(),
+ 221 b(),
+ -> 222 # c()
+ 223 ) && true;
+ 224
+ 225 try {
+ => 226 |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+
+INSERTING AT: 223:0
+PAUSES AT: 226:4
+ 220 a(),
+ 221 b(),
+ 222 c()
+ -> 223 #) && true;
+ 224
+ 225 try {
+ => 226 |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+
+INSERTING AT: 224:0
+PAUSES AT: 226:4
+ 221 b(),
+ 222 c()
+ 223 ) && true;
+ -> 224 #
+ 225 try {
+ => 226 |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+
+INSERTING AT: 225:0
+PAUSES AT: 226:4
+ 222 c()
+ 223 ) && true;
+ 224
+ -> 225 #try {
+ => 226 |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+
+INSERTING AT: 226:0
+PAUSES AT: 226:4
+ 223 ) && true;
+ 224
+ 225 try {
+-=> 226 # |throw a(), b(), c();
+ 227 } catch { }
+ 228
+ 229 try {
+
+
+INSERTING AT: 227:0
+PAUSES AT: 230:4
+ 224
+ 225 try {
+ 226 throw a(), b(), c();
+ -> 227 #} catch { }
+ 228
+ 229 try {
+ => 230 |throw a(),
+ 231 b(),
+ 232 c();
+ 233 } catch { }
+
+
+INSERTING AT: 228:0
+PAUSES AT: 230:4
+ 225 try {
+ 226 throw a(), b(), c();
+ 227 } catch { }
+ -> 228 #
+ 229 try {
+ => 230 |throw a(),
+ 231 b(),
+ 232 c();
+ 233 } catch { }
+
+
+INSERTING AT: 229:0
+PAUSES AT: 230:4
+ 226 throw a(), b(), c();
+ 227 } catch { }
+ 228
+ -> 229 #try {
+ => 230 |throw a(),
+ 231 b(),
+ 232 c();
+ 233 } catch { }
+
+
+INSERTING AT: 230:0
+PAUSES AT: 230:4
+ 227 } catch { }
+ 228
+ 229 try {
+-=> 230 # |throw a(),
+ 231 b(),
+ 232 c();
+ 233 } catch { }
+
+
+INSERTING AT: 231:0
+PAUSES AT: 231:8
+ 228
+ 229 try {
+ 230 throw a(),
+-=> 231 # |b(),
+ 232 c();
+ 233 } catch { }
+ 234
+
+
+INSERTING AT: 232:0
+PAUSES AT: 232:8
+ 229 try {
+ 230 throw a(),
+ 231 b(),
+-=> 232 # |c();
+ 233 } catch { }
+ 234
+
+
+INSERTING AT: 233:0
PRODUCES: Could not resolve breakpoint
+INSERTING AT: 234:0
+PRODUCES: Could not resolve breakpoint
+
-- Running test case: Debugger.resolvedBreakpoint.dumpEachLine.Functions
INSERTING AT: 0:0
@@ -4615,6 +4814,7 @@
-=> 122 # |inline();
123 }
124
+ 125 function returnOneLine() {
INSERTING AT: 123:0
@@ -4624,11 +4824,106 @@
122 inline();
-=> 123 |}
124
+ 125 function returnOneLine() {
+ 126 return inline(), inline(), inline();
INSERTING AT: 124:0
PRODUCES: Could not resolve breakpoint
+INSERTING AT: 125:0
+PAUSES AT: 126:4
+ 122 inline();
+ 123 }
+ 124
+ -> 125 #function returnOneLine() {
+ => 126 |return inline(), inline(), inline();
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+
+
+INSERTING AT: 126:0
+PAUSES AT: 126:4
+ 123 }
+ 124
+ 125 function returnOneLine() {
+-=> 126 # |return inline(), inline(), inline();
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+
+
+INSERTING AT: 127:0
+PAUSES AT: 127:0
+ 124
+ 125 function returnOneLine() {
+ 126 return inline(), inline(), inline();
+-=> 127 |}
+ 128
+ 129 function returnMultiLine() {
+ 130 return inline(),
+
+
+INSERTING AT: 128:0
+PRODUCES: Could not resolve breakpoint
+
+INSERTING AT: 129:0
+PAUSES AT: 130:4
+ 126 return inline(), inline(), inline();
+ 127 }
+ 128
+ -> 129 #function returnMultiLine() {
+ => 130 |return inline(),
+ 131 inline(),
+ 132 inline();
+ 133 }
+
+
+INSERTING AT: 130:0
+PAUSES AT: 130:4
+ 127 }
+ 128
+ 129 function returnMultiLine() {
+-=> 130 # |return inline(),
+ 131 inline(),
+ 132 inline();
+ 133 }
+
+
+INSERTING AT: 131:0
+PAUSES AT: 131:8
+ 128
+ 129 function returnMultiLine() {
+ 130 return inline(),
+-=> 131 # |inline(),
+ 132 inline();
+ 133 }
+ 134
+
+
+INSERTING AT: 132:0
+PAUSES AT: 132:8
+ 129 function returnMultiLine() {
+ 130 return inline(),
+ 131 inline(),
+-=> 132 # |inline();
+ 133 }
+ 134
+
+
+INSERTING AT: 133:0
+PAUSES AT: 133:0
+ 130 return inline(),
+ 131 inline(),
+ 132 inline();
+-=> 133 |}
+ 134
+
+
+INSERTING AT: 134:0
+PRODUCES: Could not resolve breakpoint
+
-- Running test case: Debugger.resolvedBreakpoint.dumpEachLine.Unicode
INSERTING AT: 0:0
Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-functions.js (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-functions.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-functions.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -122,3 +122,13 @@
inline(),
inline();
}
+
+function returnOneLine() {
+ return inline(), inline(), inline();
+}
+
+function returnMultiLine() {
+ return inline(),
+ inline(),
+ inline();
+}
Modified: trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-general.js (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-general.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-general.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -215,4 +215,20 @@
b(),
c();
-true && (a(), b(), c());
+true && (a(), b(), c()) && true;
+
+true && (
+ a(),
+ b(),
+ c()
+) && true;
+
+try {
+ throw a(), b(), c();
+} catch { }
+
+try {
+ throw a(),
+ b(),
+ c();
+} catch { }
Modified: trunk/LayoutTests/inspector/debugger/resources/log-pause-location.js (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/resources/log-pause-location.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/resources/log-pause-location.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -155,6 +155,10 @@
InspectorTest.log("ACTION: step-out");
WI.debuggerManager.stepOut();
break;
+ case "next":
+ InspectorTest.log("ACTION: step-next");
+ WI.debuggerManager.stepNext();
+ break;
case "resume":
InspectorTest.log("ACTION: resume");
WI.debuggerManager.resume();
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepInto-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepInto-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepInto-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -42,7 +42,7 @@
RESUMED
--- Running test case: Debugger.stepInto.function
+-- Running test case: Debugger.stepInto.functions
PAUSED (debugger-statement)
PAUSE AT testFunctions:18:5
14 }
@@ -151,7 +151,7 @@
-> 27 |let after = 2;
28 }
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
PAUSE AT testEval:29:2
25 let before = 1;
@@ -159,16 +159,16 @@
27 let after = 2;
-> 28 }|
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
RESUMED
--- Running test case: Debugger.stepInto.innerFunction
+-- Running test case: Debugger.stepInto.anonymousFunction
PAUSED (debugger-statement)
PAUSE AT <anonymous>:33:9
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
-> 32 |debugger;
33 let inner = 1;
@@ -176,7 +176,7 @@
35 let outer = 2;
PAUSE AT <anonymous>:34:9
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
32 debugger;
-> 33 |let inner = 1;
@@ -193,7 +193,7 @@
36 }
37
-PAUSE AT testInnerFunction:36:5
+PAUSE AT testAnonymousFunction:36:5
32 debugger;
33 let inner = 1;
34 })();
@@ -202,7 +202,7 @@
37
38 function testCommas() {
-PAUSE AT testInnerFunction:37:2
+PAUSE AT testAnonymousFunction:37:2
33 let inner = 1;
34 })();
35 let outer = 2;
@@ -240,7 +240,7 @@
-> 41 |y = 2,
42 z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
PAUSE AT testCommas:43:9
39 debugger;
@@ -248,7 +248,7 @@
41 y = 2,
-> 42 |z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
PAUSE AT testCommas:44:5
@@ -256,7 +256,7 @@
41 y = 2,
42 z = 3;
-> 43 |a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -283,7 +283,7 @@
41 y = 2,
42 z = 3;
-> 43 a(), |b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -310,7 +310,7 @@
41 y = 2,
42 z = 3;
-> 43 a(), b(), |c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -336,20 +336,11 @@
41 y = 2,
42 z = 3;
43 a(), b(), c();
- -> 44 |true && (a(), b(), c());
+ -> 44 |true && (a(), b(), c()) && true;
45 }
46
47 function testChainedExpressions() {
-PAUSE AT testCommas:45:14
- 41 y = 2,
- 42 z = 3;
- 43 a(), b(), c();
- -> 44 true && (|a(), b(), c());
- 45 }
- 46
- 47 function testChainedExpressions() {
-
PAUSE AT a:7:16
3 <script src=""
4 <script src=""
@@ -372,7 +363,7 @@
41 y = 2,
42 z = 3;
43 a(), b(), c();
- -> 44 true && (a(), |b(), c());
+ -> 44 true && (a(), |b(), c()) && true;
45 }
46
47 function testChainedExpressions() {
@@ -399,7 +390,7 @@
41 y = 2,
42 z = 3;
43 a(), b(), c();
- -> 44 true && (a(), b(), |c());
+ -> 44 true && (a(), b(), |c()) && true;
45 }
46
47 function testChainedExpressions() {
@@ -425,7 +416,7 @@
PAUSE AT testCommas:46:2
42 z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
-> 45 }|
46
47 function testChainedExpressions() {
@@ -451,7 +442,7 @@
-> 49 |a() && b() && c();
50 }
51
- 52 // ---------
+ 52 function testDeclarations() {
PAUSE AT a:7:16
3 <script src=""
@@ -478,7 +469,7 @@
-> 49 a() && |b() && c();
50 }
51
- 52 // ---------
+ 52 function testDeclarations() {
PAUSE AT b:8:16
4 <script src=""
@@ -505,7 +496,7 @@
-> 49 a() && b() && |c();
50 }
51
- 52 // ---------
+ 52 function testDeclarations() {
PAUSE AT c:9:16
5 <script>
@@ -531,8 +522,151 @@
49 a() && b() && c();
-> 50 }|
51
- 52 // ---------
- 53
+ 52 function testDeclarations() {
+ 53 debugger;
RESUMED
+-- Running test case: Debugger.stepInto.declarations
+PAUSED (debugger-statement)
+PAUSE AT testDeclarations:54:5
+ 50 }
+ 51
+ 52 function testDeclarations() {
+ -> 53 |debugger;
+ 54 let x = a(),
+ 55 y = b(),
+ 56 z = c();
+
+PAUSE AT testDeclarations:55:5
+ 51
+ 52 function testDeclarations() {
+ 53 debugger;
+ -> 54 |let x = a(),
+ 55 y = b(),
+ 56 z = c();
+ 57 }
+
+PAUSE AT a:7:16
+ 3 <script src=""
+ 4 <script src=""
+ 5 <script>
+ -> 6 function a() { |return "a"; }
+ 7 function b() { return "b"; }
+ 8 function c() { return "c"; }
+ 9
+
+PAUSE AT a:7:29
+ 3 <script src=""
+ 4 <script src=""
+ 5 <script>
+ -> 6 function a() { return "a"; }|
+ 7 function b() { return "b"; }
+ 8 function c() { return "c"; }
+ 9
+
+PAUSE AT testDeclarations:56:9
+ 52 function testDeclarations() {
+ 53 debugger;
+ 54 let x = a(),
+ -> 55 |y = b(),
+ 56 z = c();
+ 57 }
+ 58
+
+PAUSE AT b:8:16
+ 4 <script src=""
+ 5 <script>
+ 6 function a() { return "a"; }
+ -> 7 function b() { |return "b"; }
+ 8 function c() { return "c"; }
+ 9
+ 10 function testStatements() {
+
+PAUSE AT b:8:29
+ 4 <script src=""
+ 5 <script>
+ 6 function a() { return "a"; }
+ -> 7 function b() { return "b"; }|
+ 8 function c() { return "c"; }
+ 9
+ 10 function testStatements() {
+
+PAUSE AT testDeclarations:57:9
+ 53 debugger;
+ 54 let x = a(),
+ 55 y = b(),
+ -> 56 |z = c();
+ 57 }
+ 58
+ 59 function testInnerFunction() {
+
+PAUSE AT c:9:16
+ 5 <script>
+ 6 function a() { return "a"; }
+ 7 function b() { return "b"; }
+ -> 8 function c() { |return "c"; }
+ 9
+ 10 function testStatements() {
+ 11 debugger;
+
+PAUSE AT c:9:29
+ 5 <script>
+ 6 function a() { return "a"; }
+ 7 function b() { return "b"; }
+ -> 8 function c() { return "c"; }|
+ 9
+ 10 function testStatements() {
+ 11 debugger;
+
+PAUSE AT testDeclarations:58:2
+ 54 let x = a(),
+ 55 y = b(),
+ 56 z = c();
+ -> 57 }|
+ 58
+ 59 function testInnerFunction() {
+ 60 function alpha() {
+
+RESUMED
+
+-- Running test case: Debugger.stepInto.innerFunction
+PAUSED (debugger-statement)
+PAUSE AT beta:65:9
+ 61 beta();
+ 62 }
+ 63 function beta() {
+ -> 64 |debugger;
+ 65 }
+ 66 alpha();
+ 67 }
+
+PAUSE AT beta:66:6
+ 62 }
+ 63 function beta() {
+ 64 debugger;
+ -> 65 }|
+ 66 alpha();
+ 67 }
+ 68
+
+PAUSE AT alpha:63:6
+ 59 function testInnerFunction() {
+ 60 function alpha() {
+ 61 beta();
+ -> 62 }|
+ 63 function beta() {
+ 64 debugger;
+ 65 }
+
+PAUSE AT testInnerFunction:68:2
+ 64 debugger;
+ 65 }
+ 66 alpha();
+ -> 67 }|
+ 68
+ 69 // ---------
+ 70
+
+RESUMED
+
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepInto.html (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepInto.html 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepInto.html 2020-04-22 17:24:14 UTC (rev 260520)
@@ -28,7 +28,7 @@
let after = 2;
}
-function testInnerFunction() {
+function testAnonymousFunction() {
(function() {
debugger;
let inner = 1;
@@ -42,7 +42,7 @@
y = 2,
z = 3;
a(), b(), c();
- true && (a(), b(), c());
+ true && (a(), b(), c()) && true;
}
function testChainedExpressions() {
@@ -50,6 +50,23 @@
a() && b() && c();
}
+function testDeclarations() {
+ debugger;
+ let x = a(),
+ y = b(),
+ z = c();
+}
+
+function testInnerFunction() {
+ function alpha() {
+ beta();
+ }
+ function beta() {
+ debugger;
+ }
+ alpha();
+}
+
// ---------
function test()
@@ -56,7 +73,7 @@
{
let suite = InspectorTest.createAsyncSuite("Debugger.stepInto");
- // Always step-in when call frames change.
+ // Always step-into when call frames change.
WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.CallFramesDidChange, (event) => {
if (!WI.debuggerManager.activeCallFrame)
return;
@@ -87,7 +104,7 @@
});
addTestCase({
- name: "Debugger.stepInto.function",
+ name: "Debugger.stepInto.functions",
description: "step-into should step into function calls.",
_expression_: "setTimeout(testFunctions)",
});
@@ -99,9 +116,9 @@
});
addTestCase({
- name: "Debugger.stepInto.innerFunction",
+ name: "Debugger.stepInto.anonymousFunction",
description: "step-into should step out of a function to its caller.",
- _expression_: "setTimeout(testInnerFunction)",
+ _expression_: "setTimeout(testAnonymousFunction)",
});
addTestCase({
@@ -116,6 +133,18 @@
_expression_: "setTimeout(testChainedExpressions)",
});
+ addTestCase({
+ name: "Debugger.stepInto.declarations",
+ description: "step-into should step into each declaration.",
+ _expression_: "setTimeout(testDeclarations)",
+ });
+
+ addTestCase({
+ name: "Debugger.stepInto.innerFunction",
+ description: "step-into should step out of a function to its caller.",
+ _expression_: "setTimeout(testInnerFunction)",
+ });
+
loadMainPageContent().then(() => {
suite.runTestCasesAndFinish();
});
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepNext-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepNext-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepNext-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -42,7 +42,7 @@
RESUMED
--- Running test case: Debugger.stepNext.function
+-- Running test case: Debugger.stepNext.functions
PAUSED (debugger-statement)
PAUSE AT testFunctions:18:5
14 }
@@ -127,7 +127,7 @@
-> 27 |let after = 2;
28 }
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
PAUSE AT testEval:29:2
25 let before = 1;
@@ -135,16 +135,16 @@
27 let after = 2;
-> 28 }|
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
RESUMED
--- Running test case: Debugger.stepNext.innerFunction
+-- Running test case: Debugger.stepNext.anonymousFunction
PAUSED (debugger-statement)
PAUSE AT <anonymous>:33:9
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
-> 32 |debugger;
33 let inner = 1;
@@ -152,7 +152,7 @@
35 let outer = 2;
PAUSE AT <anonymous>:34:9
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
32 debugger;
-> 33 |let inner = 1;
@@ -169,7 +169,7 @@
36 }
37
-PAUSE AT testInnerFunction:36:5
+PAUSE AT testAnonymousFunction:36:5
32 debugger;
33 let inner = 1;
34 })();
@@ -178,7 +178,7 @@
37
38 function testCommas() {
-PAUSE AT testInnerFunction:37:2
+PAUSE AT testAnonymousFunction:37:2
33 let inner = 1;
34 })();
35 let outer = 2;
@@ -216,7 +216,7 @@
-> 41 |y = 2,
42 z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
PAUSE AT testCommas:43:9
39 debugger;
@@ -224,7 +224,7 @@
41 y = 2,
-> 42 |z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
PAUSE AT testCommas:44:5
@@ -232,7 +232,7 @@
41 y = 2,
42 z = 3;
-> 43 |a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -241,7 +241,7 @@
41 y = 2,
42 z = 3;
-> 43 a(), |b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -250,7 +250,7 @@
41 y = 2,
42 z = 3;
-> 43 a(), b(), |c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -258,25 +258,16 @@
41 y = 2,
42 z = 3;
43 a(), b(), c();
- -> 44 |true && (a(), b(), c());
+ -> 44 |true && (a(), b(), c()) && true;
45 }
46
47 function testChainedExpressions() {
-PAUSE AT testCommas:45:14
- 41 y = 2,
- 42 z = 3;
- 43 a(), b(), c();
- -> 44 true && (|a(), b(), c());
- 45 }
- 46
- 47 function testChainedExpressions() {
-
PAUSE AT testCommas:45:19
41 y = 2,
42 z = 3;
43 a(), b(), c();
- -> 44 true && (a(), |b(), c());
+ -> 44 true && (a(), |b(), c()) && true;
45 }
46
47 function testChainedExpressions() {
@@ -285,7 +276,7 @@
41 y = 2,
42 z = 3;
43 a(), b(), c();
- -> 44 true && (a(), b(), |c());
+ -> 44 true && (a(), b(), |c()) && true;
45 }
46
47 function testChainedExpressions() {
@@ -293,7 +284,7 @@
PAUSE AT testCommas:46:2
42 z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
-> 45 }|
46
47 function testChainedExpressions() {
@@ -319,7 +310,7 @@
-> 49 |a() && b() && c();
50 }
51
- 52 // ---------
+ 52 function testDeclarations() {
PAUSE AT testChainedExpressions:50:12
46
@@ -328,7 +319,7 @@
-> 49 a() && |b() && c();
50 }
51
- 52 // ---------
+ 52 function testDeclarations() {
PAUSE AT testChainedExpressions:50:19
46
@@ -337,7 +328,7 @@
-> 49 a() && b() && |c();
50 }
51
- 52 // ---------
+ 52 function testDeclarations() {
PAUSE AT testChainedExpressions:51:2
47 function testChainedExpressions() {
@@ -345,8 +336,97 @@
49 a() && b() && c();
-> 50 }|
51
- 52 // ---------
- 53
+ 52 function testDeclarations() {
+ 53 debugger;
RESUMED
+-- Running test case: Debugger.stepNext.declarations
+PAUSED (debugger-statement)
+PAUSE AT testDeclarations:54:5
+ 50 }
+ 51
+ 52 function testDeclarations() {
+ -> 53 |debugger;
+ 54 let x = a(),
+ 55 y = b(),
+ 56 z = c();
+
+PAUSE AT testDeclarations:55:5
+ 51
+ 52 function testDeclarations() {
+ 53 debugger;
+ -> 54 |let x = a(),
+ 55 y = b(),
+ 56 z = c();
+ 57 }
+
+PAUSE AT testDeclarations:56:9
+ 52 function testDeclarations() {
+ 53 debugger;
+ 54 let x = a(),
+ -> 55 |y = b(),
+ 56 z = c();
+ 57 }
+ 58
+
+PAUSE AT testDeclarations:57:9
+ 53 debugger;
+ 54 let x = a(),
+ 55 y = b(),
+ -> 56 |z = c();
+ 57 }
+ 58
+ 59 function testInnerFunction() {
+
+PAUSE AT testDeclarations:58:2
+ 54 let x = a(),
+ 55 y = b(),
+ 56 z = c();
+ -> 57 }|
+ 58
+ 59 function testInnerFunction() {
+ 60 function alpha() {
+
+RESUMED
+
+-- Running test case: Debugger.stepNext.innerFunction
+PAUSED (debugger-statement)
+PAUSE AT beta:65:9
+ 61 beta();
+ 62 }
+ 63 function beta() {
+ -> 64 |debugger;
+ 65 }
+ 66 alpha();
+ 67 }
+
+PAUSE AT beta:66:6
+ 62 }
+ 63 function beta() {
+ 64 debugger;
+ -> 65 }|
+ 66 alpha();
+ 67 }
+ 68
+
+PAUSE AT alpha:63:6
+ 59 function testInnerFunction() {
+ 60 function alpha() {
+ 61 beta();
+ -> 62 }|
+ 63 function beta() {
+ 64 debugger;
+ 65 }
+
+PAUSE AT testInnerFunction:68:2
+ 64 debugger;
+ 65 }
+ 66 alpha();
+ -> 67 }|
+ 68
+ 69 // ---------
+ 70
+
+RESUMED
+
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepNext.html (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepNext.html 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepNext.html 2020-04-22 17:24:14 UTC (rev 260520)
@@ -28,7 +28,7 @@
let after = 2;
}
-function testInnerFunction() {
+function testAnonymousFunction() {
(function() {
debugger;
let inner = 1;
@@ -42,7 +42,7 @@
y = 2,
z = 3;
a(), b(), c();
- true && (a(), b(), c());
+ true && (a(), b(), c()) && true;
}
function testChainedExpressions() {
@@ -50,6 +50,23 @@
a() && b() && c();
}
+function testDeclarations() {
+ debugger;
+ let x = a(),
+ y = b(),
+ z = c();
+}
+
+function testInnerFunction() {
+ function alpha() {
+ beta();
+ }
+ function beta() {
+ debugger;
+ }
+ alpha();
+}
+
// ---------
function test()
@@ -87,7 +104,7 @@
});
addTestCase({
- name: "Debugger.stepNext.function",
+ name: "Debugger.stepNext.functions",
description: "step-next should step over function calls.",
_expression_: "setTimeout(testFunctions)",
});
@@ -99,9 +116,9 @@
});
addTestCase({
- name: "Debugger.stepNext.innerFunction",
+ name: "Debugger.stepNext.anonymousFunction",
description: "step-next should step out of a function to its caller.",
- _expression_: "setTimeout(testInnerFunction)",
+ _expression_: "setTimeout(testAnonymousFunction)",
});
addTestCase({
@@ -116,6 +133,18 @@
_expression_: "setTimeout(testChainedExpressions)",
});
+ addTestCase({
+ name: "Debugger.stepNext.declarations",
+ description: "step-next should step to each declaration.",
+ _expression_: "setTimeout(testDeclarations)",
+ });
+
+ addTestCase({
+ name: "Debugger.stepNext.innerFunction",
+ description: "step-next should step out of a function to its caller.",
+ _expression_: "setTimeout(testInnerFunction)",
+ });
+
loadMainPageContent().then(() => {
suite.runTestCasesAndFinish();
});
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepOut-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepOut-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepOut-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -4,10 +4,10 @@
== Running test suite: Debugger.stepOut
-- Running test case: Debugger.stepOut.function
PAUSED (debugger-statement)
-PAUSE AT testFunctions:12:5
+PAUSE AT testFunction:12:5
8 function c() { return "c"; }
9
- 10 function testFunctions() {
+ 10 function testFunction() {
-> 11 |debugger;
12 let x = 1;
13 let y = 2;
@@ -101,3 +101,16 @@
RESUMED
+-- Running test case: Debugger.stepOut.declarations
+PAUSED (debugger-statement)
+PAUSE AT testDeclarations:56:5
+ 52 }
+ 53
+ 54 function testDeclarations() {
+ -> 55 |debugger;
+ 56 let x = a(),
+ 57 y = b(),
+ 58 z = c();
+
+RESUMED
+
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepOut.html (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepOut.html 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepOut.html 2020-04-22 17:24:14 UTC (rev 260520)
@@ -8,7 +8,7 @@
function b() { return "b"; }
function c() { return "c"; }
-function testFunctions() {
+function testFunction() {
debugger;
let x = 1;
let y = 2;
@@ -44,7 +44,7 @@
y = 2,
z = 3;
a(), b(), c();
- true && (a(), b(), c());
+ true && (a(), b(), c()) && true;
}
function testChainedExpressions() {
@@ -52,6 +52,13 @@
a() && b() && c();
}
+function testDeclarations() {
+ debugger;
+ let x = a(),
+ y = b(),
+ z = c();
+}
+
// ---------
function test()
@@ -85,7 +92,7 @@
addTestCase({
name: "Debugger.stepOut.function",
description: "step-out should leave a function.",
- _expression_: "setTimeout(testFunctions)",
+ _expression_: "setTimeout(testFunction)",
});
addTestCase({
@@ -118,6 +125,12 @@
_expression_: "setTimeout(testChainedExpressions)",
});
+ addTestCase({
+ name: "Debugger.stepOut.declarations",
+ description: "step-out should leave a function.",
+ _expression_: "setTimeout(testDeclarations)",
+ });
+
loadMainPageContent().then(() => {
suite.runTestCasesAndFinish();
});
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -42,7 +42,7 @@
RESUMED
--- Running test case: Debugger.stepOver.function
+-- Running test case: Debugger.stepOver.functions
PAUSED (debugger-statement)
PAUSE AT testFunctions:18:5
14 }
@@ -127,7 +127,7 @@
-> 27 |let after = 2;
28 }
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
PAUSE AT testEval:29:2
25 let before = 1;
@@ -135,16 +135,16 @@
27 let after = 2;
-> 28 }|
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
RESUMED
--- Running test case: Debugger.stepOver.innerFunction
+-- Running test case: Debugger.stepOver.anonymousFunction
PAUSED (debugger-statement)
PAUSE AT <anonymous>:33:9
29
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
-> 32 |debugger;
33 let inner = 1;
@@ -152,7 +152,7 @@
35 let outer = 2;
PAUSE AT <anonymous>:34:9
- 30 function testInnerFunction() {
+ 30 function testAnonymousFunction() {
31 (function() {
32 debugger;
-> 33 |let inner = 1;
@@ -169,7 +169,7 @@
36 }
37
-PAUSE AT testInnerFunction:36:5
+PAUSE AT testAnonymousFunction:36:5
32 debugger;
33 let inner = 1;
34 })();
@@ -178,7 +178,7 @@
37
38 function testCommas() {
-PAUSE AT testInnerFunction:37:2
+PAUSE AT testAnonymousFunction:37:2
33 let inner = 1;
34 })();
35 let outer = 2;
@@ -216,7 +216,7 @@
-> 41 |y = 2,
42 z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
PAUSE AT testCommas:43:9
39 debugger;
@@ -224,7 +224,7 @@
41 y = 2,
-> 42 |z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
PAUSE AT testCommas:44:5
@@ -232,7 +232,7 @@
41 y = 2,
42 z = 3;
-> 43 |a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -241,7 +241,7 @@
41 y = 2,
42 z = 3;
-> 43 a(), |b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -250,7 +250,7 @@
41 y = 2,
42 z = 3;
-> 43 a(), b(), |c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
45 }
46
@@ -258,42 +258,15 @@
41 y = 2,
42 z = 3;
43 a(), b(), c();
- -> 44 |true && (a(), b(), c());
+ -> 44 |true && (a(), b(), c()) && true;
45 }
46
47 function testChainedExpressions() {
-PAUSE AT testCommas:45:14
- 41 y = 2,
- 42 z = 3;
- 43 a(), b(), c();
- -> 44 true && (|a(), b(), c());
- 45 }
- 46
- 47 function testChainedExpressions() {
-
-PAUSE AT testCommas:45:19
- 41 y = 2,
- 42 z = 3;
- 43 a(), b(), c();
- -> 44 true && (a(), |b(), c());
- 45 }
- 46
- 47 function testChainedExpressions() {
-
-PAUSE AT testCommas:45:24
- 41 y = 2,
- 42 z = 3;
- 43 a(), b(), c();
- -> 44 true && (a(), b(), |c());
- 45 }
- 46
- 47 function testChainedExpressions() {
-
PAUSE AT testCommas:46:2
42 z = 3;
43 a(), b(), c();
- 44 true && (a(), b(), c());
+ 44 true && (a(), b(), c()) && true;
-> 45 }|
46
47 function testChainedExpressions() {
@@ -319,7 +292,7 @@
-> 49 |a() && b() && c();
50 }
51
- 52 // ---------
+ 52 function testDeclarations() {
PAUSE AT testChainedExpressions:51:2
47 function testChainedExpressions() {
@@ -327,8 +300,97 @@
49 a() && b() && c();
-> 50 }|
51
- 52 // ---------
- 53
+ 52 function testDeclarations() {
+ 53 debugger;
RESUMED
+-- Running test case: Debugger.stepOver.declarations
+PAUSED (debugger-statement)
+PAUSE AT testDeclarations:54:5
+ 50 }
+ 51
+ 52 function testDeclarations() {
+ -> 53 |debugger;
+ 54 let x = a(),
+ 55 y = b(),
+ 56 z = c();
+
+PAUSE AT testDeclarations:55:5
+ 51
+ 52 function testDeclarations() {
+ 53 debugger;
+ -> 54 |let x = a(),
+ 55 y = b(),
+ 56 z = c();
+ 57 }
+
+PAUSE AT testDeclarations:56:9
+ 52 function testDeclarations() {
+ 53 debugger;
+ 54 let x = a(),
+ -> 55 |y = b(),
+ 56 z = c();
+ 57 }
+ 58
+
+PAUSE AT testDeclarations:57:9
+ 53 debugger;
+ 54 let x = a(),
+ 55 y = b(),
+ -> 56 |z = c();
+ 57 }
+ 58
+ 59 function testInnerFunction() {
+
+PAUSE AT testDeclarations:58:2
+ 54 let x = a(),
+ 55 y = b(),
+ 56 z = c();
+ -> 57 }|
+ 58
+ 59 function testInnerFunction() {
+ 60 function alpha() {
+
+RESUMED
+
+-- Running test case: Debugger.stepOver.innerFunction
+PAUSED (debugger-statement)
+PAUSE AT beta:65:9
+ 61 beta();
+ 62 }
+ 63 function beta() {
+ -> 64 |debugger;
+ 65 }
+ 66 alpha();
+ 67 }
+
+PAUSE AT beta:66:6
+ 62 }
+ 63 function beta() {
+ 64 debugger;
+ -> 65 }|
+ 66 alpha();
+ 67 }
+ 68
+
+PAUSE AT alpha:63:6
+ 59 function testInnerFunction() {
+ 60 function alpha() {
+ 61 beta();
+ -> 62 }|
+ 63 function beta() {
+ 64 debugger;
+ 65 }
+
+PAUSE AT testInnerFunction:68:2
+ 64 debugger;
+ 65 }
+ 66 alpha();
+ -> 67 }|
+ 68
+ 69 // ---------
+ 70
+
+RESUMED
+
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepOver.html (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepOver.html 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepOver.html 2020-04-22 17:24:14 UTC (rev 260520)
@@ -28,7 +28,7 @@
let after = 2;
}
-function testInnerFunction() {
+function testAnonymousFunction() {
(function() {
debugger;
let inner = 1;
@@ -42,7 +42,7 @@
y = 2,
z = 3;
a(), b(), c();
- true && (a(), b(), c());
+ true && (a(), b(), c()) && true;
}
function testChainedExpressions() {
@@ -50,6 +50,23 @@
a() && b() && c();
}
+function testDeclarations() {
+ debugger;
+ let x = a(),
+ y = b(),
+ z = c();
+}
+
+function testInnerFunction() {
+ function alpha() {
+ beta();
+ }
+ function beta() {
+ debugger;
+ }
+ alpha();
+}
+
// ---------
function test()
@@ -87,7 +104,7 @@
});
addTestCase({
- name: "Debugger.stepOver.function",
+ name: "Debugger.stepOver.functions",
description: "step-over should step over function calls.",
_expression_: "setTimeout(testFunctions)",
});
@@ -99,9 +116,9 @@
});
addTestCase({
- name: "Debugger.stepOver.innerFunction",
+ name: "Debugger.stepOver.anonymousFunction",
description: "step-over should step out of a function to its caller.",
- _expression_: "setTimeout(testInnerFunction)",
+ _expression_: "setTimeout(testAnonymousFunction)",
});
addTestCase({
@@ -116,6 +133,18 @@
_expression_: "setTimeout(testChainedExpressions)",
});
+ addTestCase({
+ name: "Debugger.stepOver.declarations",
+ description: "step-over should step over each declaration.",
+ _expression_: "setTimeout(testDeclarations)",
+ });
+
+ addTestCase({
+ name: "Debugger.stepOver.innerFunction",
+ description: "step-over should step out of a function to its caller.",
+ _expression_: "setTimeout(testInnerFunction)",
+ });
+
loadMainPageContent().then(() => {
suite.runTestCasesAndFinish();
});
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepping-control-flow-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepping-control-flow-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepping-control-flow-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -828,7 +828,7 @@
-- Running test case: Debugger.stepping.IfWithCommas
_expression_: setTimeout(entryIfWithCommas)
-STEPS: over, over, over, over, over, resume
+STEPS: over, next, next, next, over, resume
PAUSED (debugger-statement)
PAUSE AT entryIfWithCommas:112:5
108 }
@@ -849,7 +849,7 @@
114 }
115
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryIfWithCommas:113:14
109
110 function entryIfWithCommas() {
@@ -859,7 +859,7 @@
114 }
115
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryIfWithCommas:113:19
109
110 function entryIfWithCommas() {
@@ -869,7 +869,7 @@
114 }
115
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryIfWithCommas:114:9
110 function entryIfWithCommas() {
111 debugger;
@@ -877,7 +877,7 @@
-> 113 |b();
114 }
115
- 116 // ---------
+ 116 function entryReturnWithCommas() {
ACTION: step-over
PAUSE AT entryIfWithCommas:115:2
@@ -886,10 +886,144 @@
113 b();
-> 114 }|
115
- 116 // ---------
- 117
+ 116 function entryReturnWithCommas() {
+ 117 debugger;
ACTION: resume
RESUMED
PASS: Should have used all steps.
+-- Running test case: Debugger.stepping.ReturnWithCommas
+_expression_: setTimeout(entryReturnWithCommas)
+STEPS: over, next, next, next, over, resume
+PAUSED (debugger-statement)
+PAUSE AT entryReturnWithCommas:118:5
+ 114 }
+ 115
+ 116 function entryReturnWithCommas() {
+ -> 117 |debugger;
+ 118 return a(), b(), a();
+ 119 }
+ 120
+
+ACTION: step-over
+PAUSE AT entryReturnWithCommas:119:5
+ 115
+ 116 function entryReturnWithCommas() {
+ 117 debugger;
+ -> 118 |return a(), b(), a();
+ 119 }
+ 120
+ 121 function entryThrowWithCommas() {
+
+ACTION: step-next
+PAUSE AT entryReturnWithCommas:119:12
+ 115
+ 116 function entryReturnWithCommas() {
+ 117 debugger;
+ -> 118 return |a(), b(), a();
+ 119 }
+ 120
+ 121 function entryThrowWithCommas() {
+
+ACTION: step-next
+PAUSE AT entryReturnWithCommas:119:17
+ 115
+ 116 function entryReturnWithCommas() {
+ 117 debugger;
+ -> 118 return a(), |b(), a();
+ 119 }
+ 120
+ 121 function entryThrowWithCommas() {
+
+ACTION: step-next
+PAUSE AT entryReturnWithCommas:119:22
+ 115
+ 116 function entryReturnWithCommas() {
+ 117 debugger;
+ -> 118 return a(), b(), |a();
+ 119 }
+ 120
+ 121 function entryThrowWithCommas() {
+
+ACTION: step-over
+PAUSE AT entryReturnWithCommas:120:2
+ 116 function entryReturnWithCommas() {
+ 117 debugger;
+ 118 return a(), b(), a();
+ -> 119 }|
+ 120
+ 121 function entryThrowWithCommas() {
+ 122 debugger;
+
+ACTION: resume
+RESUMED
+PASS: Should have used all steps.
+
+-- Running test case: Debugger.stepping.ThrowWithCommas
+_expression_: setTimeout(entryThrowWithCommas)
+STEPS: over, next, next, next, over, resume
+PAUSED (debugger-statement)
+PAUSE AT entryThrowWithCommas:123:5
+ 119 }
+ 120
+ 121 function entryThrowWithCommas() {
+ -> 122 |debugger;
+ 123 try {
+ 124 throw a(), b(), a();
+ 125 } catch { }
+
+ACTION: step-over
+PAUSE AT entryThrowWithCommas:125:9
+ 121 function entryThrowWithCommas() {
+ 122 debugger;
+ 123 try {
+ -> 124 |throw a(), b(), a();
+ 125 } catch { }
+ 126 }
+ 127
+
+ACTION: step-next
+PAUSE AT entryThrowWithCommas:125:15
+ 121 function entryThrowWithCommas() {
+ 122 debugger;
+ 123 try {
+ -> 124 throw |a(), b(), a();
+ 125 } catch { }
+ 126 }
+ 127
+
+ACTION: step-next
+PAUSE AT entryThrowWithCommas:125:20
+ 121 function entryThrowWithCommas() {
+ 122 debugger;
+ 123 try {
+ -> 124 throw a(), |b(), a();
+ 125 } catch { }
+ 126 }
+ 127
+
+ACTION: step-next
+PAUSE AT entryThrowWithCommas:125:25
+ 121 function entryThrowWithCommas() {
+ 122 debugger;
+ 123 try {
+ -> 124 throw a(), b(), |a();
+ 125 } catch { }
+ 126 }
+ 127
+
+ACTION: step-over
+PAUSE AT entryThrowWithCommas:127:2
+ 123 try {
+ 124 throw a(), b(), a();
+ 125 } catch { }
+ -> 126 }|
+ 127
+ 128 // ---------
+ 129
+
+ACTION: resume
+RESUMED
+PASS: Should have used all steps.
+
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepping-control-flow.html (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepping-control-flow.html 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepping-control-flow.html 2020-04-22 17:24:14 UTC (rev 260520)
@@ -114,6 +114,18 @@
b();
}
+function entryReturnWithCommas() {
+ debugger;
+ return a(), b(), a();
+}
+
+function entryThrowWithCommas() {
+ debugger;
+ try {
+ throw a(), b(), a();
+ } catch { }
+}
+
// ---------
function test()
@@ -298,14 +310,42 @@
_expression_: "setTimeout(entryIfWithCommas)",
steps: [
"over",
- "over", // a()
- "over", // b()
- "over", // a()
+ "next", // a()
+ "next", // b()
+ "next", // a()
"over", // a() - leaving entry
"resume",
]
});
+ addSteppingTestCase({
+ name: "Debugger.stepping.ReturnWithCommas",
+ description: "Should pause before each comma sub-_expression_.",
+ _expression_: "setTimeout(entryReturnWithCommas)",
+ steps: [
+ "over",
+ "next", // a()
+ "next", // b()
+ "next", // a()
+ "over", // a() - leaving entry
+ "resume",
+ ]
+ });
+
+ addSteppingTestCase({
+ name: "Debugger.stepping.ThrowWithCommas",
+ description: "Should pause before each comma sub-_expression_.",
+ _expression_: "setTimeout(entryThrowWithCommas)",
+ steps: [
+ "over",
+ "next", // a()
+ "next", // b()
+ "next", // a()
+ "over", // a() - leaving entry
+ "resume",
+ ]
+ });
+
loadMainPageContent().then(() => {
suite.runTestCasesAndFinish();
});
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepping-loops-expected.txt (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepping-loops-expected.txt 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepping-loops-expected.txt 2020-04-22 17:24:14 UTC (rev 260520)
@@ -847,7 +847,7 @@
-- Running test case: Debugger.stepping.ForWithCommasStepOver
_expression_: setTimeout(entryForWithCommas)
-STEPS: over, over, over, over, over, over, over, over, over, over, over, over, over, over, over, resume
+STEPS: over, next, over, next, over, over, next, over, next, over, over, next, over, next, over, resume
PAUSED (debugger-statement)
PAUSE AT entryForWithCommas:78:5
74 }
@@ -868,7 +868,7 @@
80 }
81
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryForWithCommas:79:21
75
76 function entryForWithCommas() {
@@ -888,7 +888,7 @@
80 }
81
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryForWithCommas:79:45
75
76 function entryForWithCommas() {
@@ -918,7 +918,7 @@
80 }
81
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryForWithCommas:79:69
75
76 function entryForWithCommas() {
@@ -938,7 +938,7 @@
80 }
81
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryForWithCommas:79:45
75
76 function entryForWithCommas() {
@@ -968,7 +968,7 @@
80 }
81
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryForWithCommas:79:69
75
76 function entryForWithCommas() {
@@ -988,7 +988,7 @@
80 }
81
-ACTION: step-over
+ACTION: step-next
PAUSE AT entryForWithCommas:79:45
75
76 function entryForWithCommas() {
Modified: trunk/LayoutTests/inspector/debugger/stepping/stepping-loops.html (260519 => 260520)
--- trunk/LayoutTests/inspector/debugger/stepping/stepping-loops.html 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/debugger/stepping/stepping-loops.html 2020-04-22 17:24:14 UTC (rev 260520)
@@ -246,19 +246,19 @@
_expression_: "setTimeout(entryForWithCommas)",
steps: [
"over",
- "over", // complete: let i = 0
+ "next", // complete: let i = 0
"over", // complete: length = 0
- "over", // complete: length = 2
+ "next", // complete: length = 2
"over", // complete: i < length
"over", // complete: a()
- "over", // complete: length = 1
+ "next", // complete: length = 1
"over", // complete: ++i
- "over", // complete: length = 2
+ "next", // complete: length = 2
"over", // complete: i < length [i=1]
"over", // complete: a()
- "over", // complete: length = 1
+ "next", // complete: length = 1
"over", // complete: ++i
- "over", // complete: length = 2
+ "next", // complete: length = 2
"over", // complete: i < length [i=2] - leaving entry
"resume",
]
Modified: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/arrow-functions-expected.js (260519 => 260520)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/arrow-functions-expected.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/arrow-functions-expected.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -59,3 +59,19 @@
2
}
}
+
+() => {
+ a(),
+ b(),
+ c()
+}
+
+() => {
+ return
+}
+() => {
+ return 42
+}
+() => {
+ return 42, a(), b()
+}
Modified: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/arrow-functions.js (260519 => 260520)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/arrow-functions.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/arrow-functions.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -30,3 +30,9 @@
a=>{for(b of[]);}
()=>{try{1}catch{2}}
+
+()=>{a(),b(),c()}
+
+()=>{return}
+()=>{return 42}
+()=>{return 42, a(), b()}
Modified: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/functions-expected.js (260519 => 260520)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/functions-expected.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/functions-expected.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -159,3 +159,22 @@
o = {
foo: async function() {}
}
+// Commas
+
+function foo() {
+ a(),
+ b(),
+ c()
+}
+
+// Return
+
+function foo() {
+ return
+}
+function foo() {
+ return 42
+}
+function foo() {
+ return 42, a(), b()
+}
Modified: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/functions.js (260519 => 260520)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/functions.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/functions.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -71,3 +71,13 @@
o={async"foo"(){}}
o={async["foo"](){}}
o={foo:async function(){}}
+
+// Commas
+
+function foo(){a(),b(),c()}
+
+// Return
+
+function foo(){return}
+function foo(){return 42}
+function foo(){return 42, a(), b()}
Modified: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements-expected.js (260519 => 260520)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements-expected.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements-expected.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -84,3 +84,5 @@
} finally {
2
}
+
+throw a(), b(), c();
Modified: trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements.js (260519 => 260520)
--- trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements.js 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/LayoutTests/inspector/formatting/resources/_javascript_-tests/try-catch-finally-statements.js 2020-04-22 17:24:14 UTC (rev 260520)
@@ -28,3 +28,5 @@
try{}catch(e){}finally{}try{}catch(e){}finally{}
try{1}catch(e){1}finally{1}try{2}catch(e){2}finally{2}
+
+throw a(),b(),c();
Modified: trunk/Source/_javascript_Core/ChangeLog (260519 => 260520)
--- trunk/Source/_javascript_Core/ChangeLog 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-04-22 17:24:14 UTC (rev 260520)
@@ -1,3 +1,33 @@
+2020-04-22 Devin Rousso <[email protected]>
+
+ Web Inspector: Debugger: Step Over should only step through comma expressions if they are comma statements
+ https://bugs.webkit.org/show_bug.cgi?id=210588
+
+ Reviewed by Brian Burg.
+
+ * parser/Nodes.h:
+ (JSC::ExpressionNode::isStatement const): Added.
+ (JSC::ExpressionNode::setIsStatement): Added.
+ * parser/NodeConstructors.h:
+ (JSC::ExprStatementNode::ExprStatementNode):
+ (JSC::DeclarationStatement::DeclarationStatement):
+ (JSC::ReturnNode::ReturnNode):
+ (JSC::ThrowNode::ThrowNode):
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::CommaNode::emitBytecode):
+ Only emit `WillExecuteStatement` debug hooks inside `CommaNode` if it's the only child of a
+ statement parent node (e.g. `a(), b(), c()` vs `true && (a(), b(), c()) && true`).
+
+ * parser/Parser.h:
+ * parser/Parser.cpp:
+ (JSC::Parser<LexerType>::parseReturnStatement):
+ (JSC::Parser<LexerType>::parseThrowStatement):
+ (JSC::Parser<LexerType>::parseExpressionOrLabelStatement):
+ (JSC::Parser<LexerType>::parseExpressionStatement):
+ (JSC::Parser<LexerType>::parseExpression):
+ Only record a pause location for each sub-_expression_ in a comma separated _expression_ if it's
+ the only child of a statement (e.g. `a(), b(), c()` vs `true && (a(), b(), c()) && true`).
+
2020-04-22 Saam Barati <[email protected]>
ValueBitNot is wrong in FTL with AnyBigIntUse
Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (260519 => 260520)
--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2020-04-22 17:24:14 UTC (rev 260520)
@@ -3294,12 +3294,14 @@
RegisterID* CommaNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
{
+ DebugHookType debugHookType = isOnlyChildOfStatement() ? WillExecuteStatement : WillExecuteExpression;
+
CommaNode* node = this;
for (; node->next(); node = node->next()) {
- generator.emitDebugHook(node->m_expr);
+ generator.emitDebugHook(debugHookType, node->m_expr->position());
generator.emitNode(generator.ignoredResult(), node->m_expr);
}
- generator.emitDebugHook(node->m_expr);
+ generator.emitDebugHook(debugHookType, node->m_expr->position());
return generator.emitNodeInTailPosition(dst, node->m_expr);
}
Modified: trunk/Source/_javascript_Core/parser/NodeConstructors.h (260519 => 260520)
--- trunk/Source/_javascript_Core/parser/NodeConstructors.h 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/Source/_javascript_Core/parser/NodeConstructors.h 2020-04-22 17:24:14 UTC (rev 260520)
@@ -834,6 +834,7 @@
: StatementNode(location)
, m_expr(expr)
{
+ m_expr->setIsOnlyChildOfStatement();
}
inline DeclarationStatement::DeclarationStatement(const JSTokenLocation& location, ExpressionNode* expr)
@@ -840,6 +841,7 @@
: StatementNode(location)
, m_expr(expr)
{
+ m_expr->setIsOnlyChildOfStatement();
}
inline ModuleDeclarationNode::ModuleDeclarationNode(const JSTokenLocation& location)
@@ -961,6 +963,8 @@
: StatementNode(location)
, m_value(value)
{
+ if (m_value)
+ m_value->setIsOnlyChildOfStatement();
}
inline WithNode::WithNode(const JSTokenLocation& location, ExpressionNode* expr, StatementNode* statement, const JSTextPosition& divot, uint32_t expressionLength)
@@ -983,6 +987,7 @@
: StatementNode(location)
, m_expr(expr)
{
+ m_expr->setIsOnlyChildOfStatement();
}
inline TryNode::TryNode(const JSTokenLocation& location, StatementNode* tryBlock, DestructuringPatternNode* catchPattern, StatementNode* catchBlock, VariableEnvironment& catchEnvironment, StatementNode* finallyBlock)
Modified: trunk/Source/_javascript_Core/parser/Nodes.h (260519 => 260520)
--- trunk/Source/_javascript_Core/parser/Nodes.h 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/Source/_javascript_Core/parser/Nodes.h 2020-04-22 17:24:14 UTC (rev 260520)
@@ -218,11 +218,15 @@
ResultType resultDescriptor() const { return m_resultType; }
+ bool isOnlyChildOfStatement() const { return m_isOnlyChildOfStatement; }
+ void setIsOnlyChildOfStatement() { m_isOnlyChildOfStatement = true; }
+
bool isOptionalChainBase() const { return m_isOptionalChainBase; }
void setIsOptionalChainBase() { m_isOptionalChainBase = true; }
private:
ResultType m_resultType;
+ bool m_isOnlyChildOfStatement { false };
bool m_isOptionalChainBase { false };
};
Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (260519 => 260520)
--- trunk/Source/_javascript_Core/parser/Parser.cpp 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/Source/_javascript_Core/parser/Parser.cpp 2020-04-22 17:24:14 UTC (rev 260520)
@@ -1611,7 +1611,7 @@
if (autoSemiColon())
return context.createReturnStatement(location, 0, start, end);
- TreeExpression expr = parseExpression(context);
+ TreeExpression expr = parseExpression(context, IsOnlyChildOfStatement::Yes);
failIfFalse(expr, "Cannot parse the return _expression_");
end = lastTokenEndPosition();
if (match(SEMICOLON))
@@ -1631,7 +1631,7 @@
failIfTrue(match(SEMICOLON), "Expected _expression_ after 'throw'");
semanticFailIfTrue(autoSemiColon(), "Cannot have a newline after 'throw'");
- TreeExpression expr = parseExpression(context);
+ TreeExpression expr = parseExpression(context, IsOnlyChildOfStatement::Yes);
failIfFalse(expr, "Cannot parse _expression_ for throw statement");
JSTextPosition end = lastTokenEndPosition();
failIfFalse(autoSemiColon(), "Expected a ';' after a throw statement");
@@ -3134,7 +3134,7 @@
// If we hit this path we're making a _expression_ statement, which
// by definition can't make use of continue/break so we can just
// ignore any labels we might have accumulated.
- TreeExpression _expression_ = parseExpression(context);
+ TreeExpression _expression_ = parseExpression(context, IsOnlyChildOfStatement::Yes);
failIfFalse(_expression_, "Cannot parse _expression_ statement");
if (!autoSemiColon())
failDueToUnexpectedToken();
@@ -3201,7 +3201,7 @@
}
JSTextPosition start = tokenStartPosition();
JSTokenLocation location(tokenLocation());
- TreeExpression _expression_ = parseExpression(context);
+ TreeExpression _expression_ = parseExpression(context, IsOnlyChildOfStatement::Yes);
failIfFalse(_expression_, "Cannot parse _expression_ statement");
failIfFalse(autoSemiColon(), "Parse error");
return context.createExprStatement(location, _expression_, start, m_lastTokenEndPosition.line);
@@ -3703,7 +3703,7 @@
}
template <typename LexerType>
-template <class TreeBuilder> TreeExpression Parser<LexerType>::parseExpression(TreeBuilder& context)
+template <class TreeBuilder> TreeExpression Parser<LexerType>::parseExpression(TreeBuilder& context, IsOnlyChildOfStatement isStatement)
{
failIfStackOverflow();
JSTokenLocation headLocation(tokenLocation());
@@ -3720,9 +3720,11 @@
failIfFalse(right, "Cannot parse _expression_ in a comma _expression_");
context.setEndOffset(right, m_lastTokenEndPosition.offset);
typename TreeBuilder::Comma head = context.createCommaExpr(headLocation, node);
- recordPauseLocation(context.breakpointLocation(head));
+ if (isStatement == IsOnlyChildOfStatement::Yes)
+ recordPauseLocation(context.breakpointLocation(head));
typename TreeBuilder::Comma tail = context.appendToCommaExpr(tailLocation, head, head, right);
- recordPauseLocation(context.breakpointLocation(tail));
+ if (isStatement == IsOnlyChildOfStatement::Yes)
+ recordPauseLocation(context.breakpointLocation(tail));
while (match(COMMA)) {
next(TreeBuilder::DontBuildStrings);
tailLocation = tokenLocation();
@@ -3730,7 +3732,8 @@
failIfFalse(right, "Cannot parse _expression_ in a comma _expression_");
context.setEndOffset(right, m_lastTokenEndPosition.offset);
tail = context.appendToCommaExpr(tailLocation, head, tail, right);
- recordPauseLocation(context.breakpointLocation(tail));
+ if (isStatement == IsOnlyChildOfStatement::Yes)
+ recordPauseLocation(context.breakpointLocation(tail));
}
context.setEndOffset(head, m_lastTokenEndPosition.offset);
return head;
Modified: trunk/Source/_javascript_Core/parser/Parser.h (260519 => 260520)
--- trunk/Source/_javascript_Core/parser/Parser.h 2020-04-22 17:17:43 UTC (rev 260519)
+++ trunk/Source/_javascript_Core/parser/Parser.h 2020-04-22 17:24:14 UTC (rev 260520)
@@ -1646,7 +1646,10 @@
template <class TreeBuilder> TreeStatement parseExpressionOrLabelStatement(TreeBuilder&, bool allowFunctionDeclarationAsStatement);
template <class TreeBuilder> TreeStatement parseIfStatement(TreeBuilder&);
template <class TreeBuilder> TreeStatement parseBlockStatement(TreeBuilder&, bool isCatchBlock = false);
- template <class TreeBuilder> TreeExpression parseExpression(TreeBuilder&);
+
+ enum class IsOnlyChildOfStatement { Yes, No };
+ template <class TreeBuilder> TreeExpression parseExpression(TreeBuilder&, IsOnlyChildOfStatement = IsOnlyChildOfStatement::No);
+
template <class TreeBuilder> TreeExpression parseAssignmentExpression(TreeBuilder&, ExpressionErrorClassifier&);
template <class TreeBuilder> TreeExpression parseAssignmentExpression(TreeBuilder&);
template <class TreeBuilder> TreeExpression parseAssignmentExpressionOrPropagateErrorClass(TreeBuilder&);