| Differences between
and this patch
- a/Source/JavaScriptCore/ChangeLog +23 lines
Lines 1-3 a/Source/JavaScriptCore/ChangeLog_sec1
1
2020-04-09  Devin Rousso  <drousso@apple.com>
2
3
        Web Inspector: Debugger: debug hooks should also be emitted for the first sub-expression in a comma expression
4
        https://bugs.webkit.org/show_bug.cgi?id=210253
5
6
        Reviewed by Joseph Pecoraro.
7
8
        * bytecompiler/NodesCodegen.cpp:
9
        (JSC::CommaNode::emitBytecode):
10
        * parser/Parser.cpp:
11
        (JSC::Parser<LexerType>::parseVariableDeclarationList):
12
        (JSC::Parser<LexerType>::parseExpression):
13
        We should emit debug hooks and record pause locations for the first sub-expression in comma
14
        expressions, as the comma expression is not always standalone (e.g. `true && (a(), b())`).
15
16
        * bytecompiler/BytecodeGenerator.h:
17
        * bytecompiler/BytecodeGenerator.cpp:
18
        (JSC::BytecodeGenerator::emitDebugHook):
19
        Save the `JSTextPosition` and `DebugHookType` of the last debug hook, using them to prevent
20
        any additional debug hooks from being emitted if they have the same `JSTextPosition` and
21
        `DebugHookType`. This prevents the debugger from pausing twice at the beginning of an
22
        expression statement (e.g. `|a(), b();`).
23
1
2020-04-08  Devin Rousso  <drousso@apple.com>
24
2020-04-08  Devin Rousso  <drousso@apple.com>
2
25
3
        Web Inspector: Debugger: treat comma sub-expressions as separate statements
26
        Web Inspector: Debugger: treat comma sub-expressions as separate statements
- a/Source/WebInspectorUI/ChangeLog +13 lines
Lines 1-3 a/Source/WebInspectorUI/ChangeLog_sec1
1
2020-04-09  Devin Rousso  <drousso@apple.com>
2
3
        Web Inspector: Debugger: debug hooks should also be emitted for the first sub-expression in a comma expression
4
        https://bugs.webkit.org/show_bug.cgi?id=210253
5
6
        Reviewed by Joseph Pecoraro.
7
8
        * UserInterface/Workers/Formatter/JSFormatter.js:
9
        (JSFormatter.prototype._handleTokenAtNode):
10
        (JSFormatter.prototype._isLikelyToHaveNewline): Deleted.
11
        If an arrow function wraps it's body with `{` and `}`, always add newlines to make setting
12
        breakpoints inside the function body easier.
13
1
2020-04-08  Devin Rousso  <drousso@apple.com>
14
2020-04-08  Devin Rousso  <drousso@apple.com>
2
15
3
        Web Inspector: Debugger: treat comma sub-expressions as separate statements
16
        Web Inspector: Debugger: treat comma sub-expressions as separate statements
- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp -1 / +7 lines
Lines 3535-3543 void BytecodeGenerator::emitPopWithScope() a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp_sec1
3535
3535
3536
void BytecodeGenerator::emitDebugHook(DebugHookType debugHookType, const JSTextPosition& divot)
3536
void BytecodeGenerator::emitDebugHook(DebugHookType debugHookType, const JSTextPosition& divot)
3537
{
3537
{
3538
    if (!shouldEmitDebugHooks())
3538
    if (LIKELY(!shouldEmitDebugHooks()))
3539
        return;
3539
        return;
3540
3540
3541
    if (m_lastDebugHook.position == divot && m_lastDebugHook.type == debugHookType)
3542
        return;
3543
3544
    m_lastDebugHook.position = divot;
3545
    m_lastDebugHook.type = debugHookType;
3546
3541
    emitExpressionInfo(divot, divot, divot);
3547
    emitExpressionInfo(divot, divot, divot);
3542
    OpDebug::emit(this, debugHookType, false);
3548
    OpDebug::emit(this, debugHookType, false);
3543
}
3549
}
- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h +5 lines
Lines 1312-1317 namespace JSC { a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h_sec1
1312
            VirtualRegister completionTypeRegister;
1312
            VirtualRegister completionTypeRegister;
1313
        };
1313
        };
1314
        Vector<CatchEntry> m_exceptionHandlersToEmit;
1314
        Vector<CatchEntry> m_exceptionHandlersToEmit;
1315
1316
        struct {
1317
            JSTextPosition position;
1318
            DebugHookType type { DidExecuteProgram };
1319
        } m_lastDebugHook;
1315
    };
1320
    };
1316
1321
1317
    class StrictModeScope : private SetForScope<ECMAMode> {
1322
    class StrictModeScope : private SetForScope<ECMAMode> {
- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp -4 / +2 lines
Lines 3043-3054 RegisterID* CommaNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp_sec1
3043
{
3043
{
3044
    CommaNode* node = this;
3044
    CommaNode* node = this;
3045
    for (; node->next(); node = node->next()) {
3045
    for (; node->next(); node = node->next()) {
3046
        generator.emitDebugHook(node->m_expr);
3046
        generator.emitNode(generator.ignoredResult(), node->m_expr);
3047
        generator.emitNode(generator.ignoredResult(), node->m_expr);
3047
3048
        // Don't emit a debug hook for the first expression, as that should've already happened in
3049
        // the containing statement.
3050
        generator.emitDebugHook(node->next()->m_expr);
3051
    }
3048
    }
3049
    generator.emitDebugHook(node->m_expr);
3052
    return generator.emitNodeInTailPosition(dst, node->m_expr);
3050
    return generator.emitNodeInTailPosition(dst, node->m_expr);
3053
}
3051
}
3054
3052
- a/Source/JavaScriptCore/parser/Parser.cpp -1 / +4 lines
Lines 897-904 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseVariableDecl a/Source/JavaScriptCore/parser/Parser.cpp_sec1
897
                head = node;
897
                head = node;
898
                headLocation = location;
898
                headLocation = location;
899
            } else {
899
            } else {
900
                if (!tail)
900
                if (!tail) {
901
                    head = tail = context.createCommaExpr(headLocation, head);
901
                    head = tail = context.createCommaExpr(headLocation, head);
902
                    recordPauseLocation(context.breakpointLocation(head));
903
                }
902
                tail = context.appendToCommaExpr(location, head, tail, node);
904
                tail = context.appendToCommaExpr(location, head, tail, node);
903
                recordPauseLocation(context.breakpointLocation(tail));
905
                recordPauseLocation(context.breakpointLocation(tail));
904
            }
906
            }
Lines 3718-3723 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseExpression(T a/Source/JavaScriptCore/parser/Parser.cpp_sec2
3718
    failIfFalse(right, "Cannot parse expression in a comma expression");
3720
    failIfFalse(right, "Cannot parse expression in a comma expression");
3719
    context.setEndOffset(right, m_lastTokenEndPosition.offset);
3721
    context.setEndOffset(right, m_lastTokenEndPosition.offset);
3720
    typename TreeBuilder::Comma head = context.createCommaExpr(headLocation, node);
3722
    typename TreeBuilder::Comma head = context.createCommaExpr(headLocation, node);
3723
    recordPauseLocation(context.breakpointLocation(head));
3721
    typename TreeBuilder::Comma tail = context.appendToCommaExpr(tailLocation, head, head, right);
3724
    typename TreeBuilder::Comma tail = context.appendToCommaExpr(tailLocation, head, head, right);
3722
    recordPauseLocation(context.breakpointLocation(tail));
3725
    recordPauseLocation(context.breakpointLocation(tail));
3723
    while (match(COMMA)) {
3726
    while (match(COMMA)) {
- a/Source/WebInspectorUI/UserInterface/Workers/Formatter/JSFormatter.js -27 / +2 lines
Lines 199-228 JSFormatter = class JSFormatter a/Source/WebInspectorUI/UserInterface/Workers/Formatter/JSFormatter.js_sec1
199
        return (parent.type === "ForStatement" || parent.type === "ForInStatement" || parent.type === "ForOfStatement") && node !== parent.body;
199
        return (parent.type === "ForStatement" || parent.type === "ForInStatement" || parent.type === "ForOfStatement") && node !== parent.body;
200
    }
200
    }
201
201
202
    _isLikelyToHaveNewline(node)
203
    {
204
        switch (node.type) {
205
        case "BlockStatement":
206
        case "ClassDeclaration":
207
        case "DoWhileStatement":
208
        case "ForInStatement":
209
        case "ForOfStatement":
210
        case "ForStatement":
211
        case "FunctionDeclaration":
212
        case "IfStatement":
213
        case "SwitchStatement":
214
        case "TryStatement":
215
        case "WhileStatement":
216
        case "WithStatement":
217
            return true;
218
219
        case "ExpressionStatement":
220
            return node.expression.type === "SequenceExpression";
221
        }
222
223
        return false;
224
    }
225
226
    _isRangeWhitespace(from, to)
202
    _isRangeWhitespace(from, to)
227
    {
203
    {
228
        let substring = this._sourceText.substring(from, to);
204
        let substring = this._sourceText.substring(from, to);
Lines 332-338 JSFormatter = class JSFormatter a/Source/WebInspectorUI/UserInterface/Workers/Formatter/JSFormatter.js_sec2
332
        }
308
        }
333
309
334
        if (nodeType === "BlockStatement") {
310
        if (nodeType === "BlockStatement") {
335
            let isSingleStatementArrowFunctionWithUnlikelyMultilineContent = node.parent.type === "ArrowFunctionExpression" && node.body.length === 1 && !this._isLikelyToHaveNewline(node.body[0]);
336
            if (tokenValue === "{") {
311
            if (tokenValue === "{") {
337
                // Class methods we put the opening brace on its own line.
312
                // Class methods we put the opening brace on its own line.
338
                if (node.parent && node.parent.parent && node.parent.parent.type === "MethodDefinition" && node.body.length) {
313
                if (node.parent && node.parent.parent && node.parent.parent.type === "MethodDefinition" && node.body.length) {
Lines 343-355 JSFormatter = class JSFormatter a/Source/WebInspectorUI/UserInterface/Workers/Formatter/JSFormatter.js_sec3
343
                    return;
318
                    return;
344
                }
319
                }
345
                builder.appendToken(tokenValue, tokenOffset);
320
                builder.appendToken(tokenValue, tokenOffset);
346
                if (node.body.length && !isSingleStatementArrowFunctionWithUnlikelyMultilineContent)
321
                if (node.body.length)
347
                    this._appendNewline(node);
322
                    this._appendNewline(node);
348
                builder.indent();
323
                builder.indent();
349
                return;
324
                return;
350
            }
325
            }
351
            if (tokenValue === "}") {
326
            if (tokenValue === "}") {
352
                if (node.body.length && !isSingleStatementArrowFunctionWithUnlikelyMultilineContent)
327
                if (node.body.length)
353
                    this._appendNewline(node);
328
                    this._appendNewline(node);
354
                builder.dedent();
329
                builder.dedent();
355
                builder.appendToken(tokenValue, tokenOffset);
330
                builder.appendToken(tokenValue, tokenOffset);
- a/LayoutTests/ChangeLog +18 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2020-04-09  Devin Rousso  <drousso@apple.com>
2
3
        Web Inspector: Debugger: debug hooks should also be emitted for the first sub-expression in a comma expression
4
        https://bugs.webkit.org/show_bug.cgi?id=210253
5
6
        Reviewed by Joseph Pecoraro.
7
8
        * inspector/debugger/breakpoints/resources/dump-general.js:
9
        * inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt:
10
        * inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt:
11
        * inspector/debugger/stepping/stepOver.html:
12
        * inspector/debugger/stepping/stepOver-expected.txt:
13
        * inspector/formatting/formatting-javascript.html:
14
        * inspector/formatting/formatting-javascript-expected.txt:
15
        * inspector/formatting/resources/javascript-tests/arrow-functions-expected.js:
16
        * inspector/formatting/resources/javascript-tests/comma-expressions.js: Added.
17
        * inspector/formatting/resources/javascript-tests/comma-expressions-expected.js: Added.
18
1
2020-04-08  Diego Pino Garcia  <dpino@igalia.com>
19
2020-04-08  Diego Pino Garcia  <dpino@igalia.com>
2
20
3
        [GTK] Gardening, update TestExpectations
21
        [GTK] Gardening, update TestExpectations
- a/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt +37 lines
Lines 1411-1416 PAUSES AT: 214:0 a/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt_sec1
1411
 => 214    |b(),
1411
 => 214    |b(),
1412
    215    c();
1412
    215    c();
1413
    216    
1413
    216    
1414
    217    true && (a(), b(), c());
1414
1415
1415
INSERTING AT: 214:1
1416
INSERTING AT: 214:1
1416
PAUSES AT: 215:0
1417
PAUSES AT: 215:0
Lines 1420-1425 PAUSES AT: 215:0 a/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt_sec2
1420
 -> 214    b#(),
1421
 -> 214    b#(),
1421
 => 215    |c();
1422
 => 215    |c();
1422
    216    
1423
    216    
1424
    217    true && (a(), b(), c());
1425
    218    
1426
1427
INSERTING AT: 215:1
1428
PAUSES AT: 217:0
1429
    212    
1430
    213    a(),
1431
    214    b(),
1432
 -> 215    c#();
1433
    216    
1434
 => 217    |true && (a(), b(), c());
1435
    218    
1436
1437
INSERTING AT: 217:1
1438
PAUSES AT: 217:9
1439
    214    b(),
1440
    215    c();
1441
    216    
1442
-=> 217    t#rue && (|a(), b(), c());
1443
    218    
1444
1445
INSERTING AT: 217:10
1446
PAUSES AT: 217:14
1447
    214    b(),
1448
    215    c();
1449
    216    
1450
-=> 217    true && (a#(), |b(), c());
1451
    218    
1452
1453
INSERTING AT: 217:15
1454
PAUSES AT: 217:19
1455
    214    b(),
1456
    215    c();
1457
    216    
1458
-=> 217    true && (a(), b#(), |c());
1459
    218    
1423
1460
1424
1461
1425
-- Running test case: Debugger.resolvedBreakpoint.dumpAllLocations.Functions
1462
-- Running test case: Debugger.resolvedBreakpoint.dumpAllLocations.Functions
- a/LayoutTests/inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt +22 lines
Lines 3093-3098 PAUSES AT: 214:0 a/LayoutTests/inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt_sec1
3093
-=> 214    |b(),
3093
-=> 214    |b(),
3094
    215    c();
3094
    215    c();
3095
    216    
3095
    216    
3096
    217    true && (a(), b(), c());
3096
3097
3097
3098
3098
INSERTING AT: 215:0
3099
INSERTING AT: 215:0
Lines 3102-3110 PAUSES AT: 215:0 a/LayoutTests/inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt_sec2
3102
    214    b(),
3103
    214    b(),
3103
-=> 215    |c();
3104
-=> 215    |c();
3104
    216    
3105
    216    
3106
    217    true && (a(), b(), c());
3107
    218    
3105
3108
3106
3109
3107
INSERTING AT: 216:0
3110
INSERTING AT: 216:0
3111
PAUSES AT: 217:0
3112
    213    a(),
3113
    214    b(),
3114
    215    c();
3115
 -> 216    #
3116
 => 217    |true && (a(), b(), c());
3117
    218    
3118
3119
3120
INSERTING AT: 217:0
3121
PAUSES AT: 217:0
3122
    214    b(),
3123
    215    c();
3124
    216    
3125
-=> 217    |true && (a(), b(), c());
3126
    218    
3127
3128
3129
INSERTING AT: 218:0
3108
PRODUCES: Could not resolve breakpoint
3130
PRODUCES: Could not resolve breakpoint
3109
3131
3110
-- Running test case: Debugger.resolvedBreakpoint.dumpEachLine.Functions
3132
-- Running test case: Debugger.resolvedBreakpoint.dumpEachLine.Functions
- a/LayoutTests/inspector/debugger/breakpoints/resources/dump-general.js +2 lines
Lines 214-216 a(), b(), c(); a/LayoutTests/inspector/debugger/breakpoints/resources/dump-general.js_sec1
214
a(),
214
a(),
215
b(),
215
b(),
216
c();
216
c();
217
218
true && (a(), b(), c());
- a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt -58 / +90 lines
Lines 1-7 a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt_sec1
1
ALERT: function log 1
2
ALERT: comma log 1
3
ALERT: comma log 2
4
ALERT: comma log 3
5
Checking pause locations when stepping with "stepOver".
1
Checking pause locations when stepping with "stepOver".
6
2
7
3
Lines 54-60 PAUSE AT testFunctions:18:5 a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt_sec2
54
     16    function testFunctions() {
50
     16    function testFunctions() {
55
 ->  17        |debugger;
51
 ->  17        |debugger;
56
     18        let before = 1;
52
     18        let before = 1;
57
     19        testAlert("function log 1");
53
     19        a();
58
     20        let after = 2;
54
     20        let after = 2;
59
55
60
PAUSE AT testFunctions:19:5
56
PAUSE AT testFunctions:19:5
Lines 62-68 PAUSE AT testFunctions:19:5 a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt_sec3
62
     16    function testFunctions() {
58
     16    function testFunctions() {
63
     17        debugger;
59
     17        debugger;
64
 ->  18        |let before = 1;
60
 ->  18        |let before = 1;
65
     19        testAlert("function log 1");
61
     19        a();
66
     20        let after = 2;
62
     20        let after = 2;
67
     21    }
63
     21    }
68
64
Lines 70-76 PAUSE AT testFunctions:20:5 a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt_sec4
70
     16    function testFunctions() {
66
     16    function testFunctions() {
71
     17        debugger;
67
     17        debugger;
72
     18        let before = 1;
68
     18        let before = 1;
73
 ->  19        |testAlert("function log 1");
69
 ->  19        |a();
74
     20        let after = 2;
70
     20        let after = 2;
75
     21    }
71
     21    }
76
     22    
72
     22    
Lines 78-84 PAUSE AT testFunctions:20:5 a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt_sec5
78
PAUSE AT testFunctions:21:5
74
PAUSE AT testFunctions:21:5
79
     17        debugger;
75
     17        debugger;
80
     18        let before = 1;
76
     18        let before = 1;
81
     19        testAlert("function log 1");
77
     19        a();
82
 ->  20        |let after = 2;
78
 ->  20        |let after = 2;
83
     21    }
79
     21    }
84
     22    
80
     22    
Lines 86-92 PAUSE AT testFunctions:21:5 a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt_sec6
86
82
87
PAUSE AT testFunctions:22:2
83
PAUSE AT testFunctions:22:2
88
     18        let before = 1;
84
     18        let before = 1;
89
     19        testAlert("function log 1");
85
     19        a();
90
     20        let after = 2;
86
     20        let after = 2;
91
 ->  21    }|
87
 ->  21    }|
92
     22    
88
     22    
Lines 200-271 PAUSE AT testCommas:40:5 a/LayoutTests/inspector/debugger/stepping/stepOver-expected.txt_sec7
200
     37    
196
     37    
201
     38    function testCommas() {
197
     38    function testCommas() {
202
 ->  39        |debugger;
198
 ->  39        |debugger;
203
     40        let a = 1,
199
     40        let x = 1,
204
     41            b = 2,
200
     41            y = 2,
205
     42            c = 3;
201
     42            z = 3;
206
202
207
PAUSE AT testCommas:41:5
203
PAUSE AT testCommas:41:5
208
     37    
204
     37    
209
     38    function testCommas() {
205
     38    function testCommas() {
210
     39        debugger;
206
     39        debugger;
211
 ->  40        |let a = 1,
207
 ->  40        |let x = 1,
212
     41            b = 2,
208
     41            y = 2,
213
     42            c = 3;
209
     42            z = 3;
214
     43        testAlert("comma log 1"), testAlert("comma log 2"), testAlert("comma log 3");
210
     43        a(), b(), c();
215
211
216
PAUSE AT testCommas:42:9
212
PAUSE AT testCommas:42:9
217
     38    function testCommas() {
213
     38    function testCommas() {
218
     39        debugger;
214
     39        debugger;
219
     40        let a = 1,
215
     40        let x = 1,
220
 ->  41            |b = 2,
216
 ->  41            |y = 2,
221
     42            c = 3;
217
     42            z = 3;
222
     43        testAlert("comma log 1"), testAlert("comma log 2"), testAlert("comma log 3");
218
     43        a(), b(), c();
223
     44    }
219
     44        true && (a(), b(), c());
224
220
225
PAUSE AT testCommas:43:9
221
PAUSE AT testCommas:43:9
226
     39        debugger;
222
     39        debugger;
227
     40        let a = 1,
223
     40        let x = 1,
228
     41            b = 2,
224
     41            y = 2,
229
 ->  42            |c = 3;
225
 ->  42            |z = 3;
230
     43        testAlert("comma log 1"), testAlert("comma log 2"), testAlert("comma log 3");
226
     43        a(), b(), c();
231
     44    }
227
     44        true && (a(), b(), c());
232
     45    
228
     45    }
233
229
234
PAUSE AT testCommas:44:5
230
PAUSE AT testCommas:44:5
235
     40        let a = 1,
231
     40        let x = 1,
236
     41            b = 2,
232
     41            y = 2,
237
     42            c = 3;
233
     42            z = 3;
238
 ->  43        |testAlert("comma log 1"), testAlert("comma log 2"), testAlert("comma log 3");
234
 ->  43        |a(), b(), c();
239
     44    }
235
     44        true && (a(), b(), c());
240
     45    
236
     45    }
241
     46    // ---------
237
     46    
242
238
243
PAUSE AT testCommas:44:31
239
PAUSE AT testCommas:44:10
244
     40        let a = 1,
240
     40        let x = 1,
245
     41            b = 2,
241
     41            y = 2,
246
     42            c = 3;
242
     42            z = 3;
247
 ->  43        testAlert("comma log 1"), |testAlert("comma log 2"), testAlert("comma log 3");
243
 ->  43        a(), |b(), c();
248
     44    }
244
     44        true && (a(), b(), c());
249
     45    
245
     45    }
250
     46    // ---------
246
     46    
251
247
252
PAUSE AT testCommas:44:57
248
PAUSE AT testCommas:44:15
253
     40        let a = 1,
249
     40        let x = 1,
254
     41            b = 2,
250
     41            y = 2,
255
     42            c = 3;
251
     42            z = 3;
256
 ->  43        testAlert("comma log 1"), testAlert("comma log 2"), |testAlert("comma log 3");
252
 ->  43        a(), b(), |c();
257
     44    }
253
     44        true && (a(), b(), c());
258
     45    
254
     45    }
259
     46    // ---------
255
     46    
260
256
261
PAUSE AT testCommas:45:2
257
PAUSE AT testCommas:45:5
262
     41            b = 2,
258
     41            y = 2,
263
     42            c = 3;
259
     42            z = 3;
264
     43        testAlert("comma log 1"), testAlert("comma log 2"), testAlert("comma log 3");
260
     43        a(), b(), c();
265
 ->  44    }|
261
 ->  44        |true && (a(), b(), c());
266
     45    
262
     45    }
267
     46    // ---------
263
     46    
268
     47    
264
     47    function a() { }
265
266
PAUSE AT testCommas:45:14
267
     41            y = 2,
268
     42            z = 3;
269
     43        a(), b(), c();
270
 ->  44        true && (|a(), b(), c());
271
     45    }
272
     46    
273
     47    function a() { }
274
275
PAUSE AT testCommas:45:19
276
     41            y = 2,
277
     42            z = 3;
278
     43        a(), b(), c();
279
 ->  44        true && (a(), |b(), c());
280
     45    }
281
     46    
282
     47    function a() { }
283
284
PAUSE AT testCommas:45:24
285
     41            y = 2,
286
     42            z = 3;
287
     43        a(), b(), c();
288
 ->  44        true && (a(), b(), |c());
289
     45    }
290
     46    
291
     47    function a() { }
292
293
PAUSE AT testCommas:46:2
294
     42            z = 3;
295
     43        a(), b(), c();
296
     44        true && (a(), b(), c());
297
 ->  45    }|
298
     46    
299
     47    function a() { }
300
     48    function b() { }
269
301
270
RESUMED
302
RESUMED
271
303
- a/LayoutTests/inspector/debugger/stepping/stepOver.html -5 / +10 lines
Lines 17-23 function testStatements() { a/LayoutTests/inspector/debugger/stepping/stepOver.html_sec1
17
function testFunctions() {
17
function testFunctions() {
18
    debugger;
18
    debugger;
19
    let before = 1;
19
    let before = 1;
20
    testAlert("function log 1");
20
    a();
21
    let after = 2;
21
    let after = 2;
22
}
22
}
23
23
Lines 38-49 function testLocalFunction() { a/LayoutTests/inspector/debugger/stepping/stepOver.html_sec2
38
38
39
function testCommas() {
39
function testCommas() {
40
    debugger;
40
    debugger;
41
    let a = 1,
41
    let x = 1,
42
        b = 2,
42
        y = 2,
43
        c = 3;
43
        z = 3;
44
    testAlert("comma log 1"), testAlert("comma log 2"), testAlert("comma log 3");
44
    a(), b(), c();
45
    true && (a(), b(), c());
45
}
46
}
46
47
48
function a() { }
49
function b() { }
50
function c() { }
51
47
// ---------
52
// ---------
48
53
49
function test()
54
function test()
- a/LayoutTests/inspector/formatting/formatting-javascript-expected.txt +1 lines
Lines 5-10 Test JavaScript formatting. a/LayoutTests/inspector/formatting/formatting-javascript-expected.txt_sec1
5
-- Running test case: JSFormatter
5
-- Running test case: JSFormatter
6
PASS: arrow-functions.js
6
PASS: arrow-functions.js
7
PASS: classes.js
7
PASS: classes.js
8
PASS: comma-expressions.js
8
PASS: comments-and-preserve-newlines.js
9
PASS: comments-and-preserve-newlines.js
9
PASS: comments-only.js
10
PASS: comments-only.js
10
PASS: do-while-statement.js
11
PASS: do-while-statement.js
- a/LayoutTests/inspector/formatting/formatting-javascript.html +1 lines
Lines 11-16 function test() a/LayoutTests/inspector/formatting/formatting-javascript.html_sec1
11
    addFormattingTests(suite, "text/javascript", [
11
    addFormattingTests(suite, "text/javascript", [
12
        "resources/javascript-tests/arrow-functions.js",
12
        "resources/javascript-tests/arrow-functions.js",
13
        "resources/javascript-tests/classes.js",
13
        "resources/javascript-tests/classes.js",
14
        "resources/javascript-tests/comma-expressions.js",
14
        "resources/javascript-tests/comments-and-preserve-newlines.js",
15
        "resources/javascript-tests/comments-and-preserve-newlines.js",
15
        "resources/javascript-tests/comments-only.js",
16
        "resources/javascript-tests/comments-only.js",
16
        "resources/javascript-tests/do-while-statement.js",
17
        "resources/javascript-tests/do-while-statement.js",
- a/LayoutTests/inspector/formatting/resources/javascript-tests/arrow-functions-expected.js -5 / +15 lines
Lines 1-12 a/LayoutTests/inspector/formatting/resources/javascript-tests/arrow-functions-expected.js_sec1
1
x => x;
1
x => x;
2
x => x * x;
2
x => x * x;
3
x => {x * x};
3
x => {
4
x => {x * x;};
4
    x * x
5
};
6
x => {
7
    x * x;
8
};
5
() => 1;
9
() => 1;
6
(x) => x;
10
(x) => x;
7
(x) => x * x;
11
(x) => x * x;
8
(x) => {x * x};
12
(x) => {
9
(x) => {x * x;};
13
    x * x
14
};
15
(x) => {
16
    x * x;
17
};
10
18
11
x => {
19
x => {
12
    x *= x;
20
    x *= x;
Lines 36-42 foo((a=1, b, ) => b); a/LayoutTests/inspector/formatting/resources/javascript-tests/arrow-functions-expected.js_sec2
36
44
37
async x => x
45
async x => x
38
async (x) => x
46
async (x) => x
39
async (x) => {x}
47
async (x) => {
48
    x
49
}
40
50
41
a => {
51
a => {
42
    for (b of [])
52
    for (b of [])
- a/LayoutTests/inspector/formatting/resources/javascript-tests/comma-expressions-expected.js +39 lines
Line 0 a/LayoutTests/inspector/formatting/resources/javascript-tests/comma-expressions-expected.js_sec1
1
a(x, y, z),
2
b(x, y, z),
3
c(x, y, z);
4
5
if (a(x, y, z), b(x, y, z), c(x, y, z)) {}
6
7
true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true;
8
9
(x, y, z) => {
10
    a(x, y, z),
11
    b(x, y, z),
12
    c(x, y, z)
13
}
14
15
(x, y, z) => {
16
    if (a(x, y, z), b(x, y, z), c(x, y, z)) {}
17
}
18
19
(x, y, z) => {
20
    true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true;
21
}
22
23
(x, y, z) => (a(x, y, z), b(x, y, z), c(x, y, z));
24
25
(x, y, z) => true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true;
26
27
function foo(x, y, z) {
28
    a(x, y, z),
29
    b(x, y, z),
30
    c(x, y, z)
31
}
32
33
function foo(x, y, z) {
34
    if (a(x, y, z), b(x, y, z), c(x, y, z)) {}
35
}
36
37
function foo(x, y, z) {
38
    true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true;
39
}
- a/LayoutTests/inspector/formatting/resources/javascript-tests/comma-expressions.js +21 lines
Line 0 a/LayoutTests/inspector/formatting/resources/javascript-tests/comma-expressions.js_sec1
1
a(x, y, z), b(x, y, z), c(x, y, z);
2
3
if (a(x, y, z), b(x, y, z), c(x, y, z)) { }
4
5
true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true;
6
7
(x, y, z) => { a(x, y, z), b(x, y, z), c(x, y, z) }
8
9
(x, y, z) => { if (a(x, y, z), b(x, y, z), c(x, y, z)) { } }
10
11
(x, y, z) => { true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true; }
12
13
(x, y, z) => (a(x, y, z), b(x, y, z), c(x, y, z));
14
15
(x, y, z) => true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true;
16
17
function foo(x, y, z) { a(x, y, z), b(x, y, z), c(x, y, z) }
18
19
function foo(x, y, z) { if (a(x, y, z), b(x, y, z), c(x, y, z)) { } }
20
21
function foo(x, y, z) { true && (a(x, y, z), b(x, y, z), c(x, y, z)) && true; }

Return to Bug 210253