Changeset 207312 in webkit
- Timestamp:
- Oct 13, 2016 3:20:22 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207299 r207312 1 2016-10-13 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Stepping highlight for dot/bracket expressions in if statements highlights subset of the expression 4 https://bugs.webkit.org/show_bug.cgi?id=163378 5 <rdar://problem/28749376> 6 7 Reviewed by Saam Barati. 8 9 * inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt: 10 * inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt: 11 * inspector/debugger/breakpoints/resources/dump-general.js: 12 * inspector/debugger/stepping/stepping-misc-expected.txt: 13 * inspector/debugger/stepping/stepping-misc.html: 14 Add tests for these kinds of special cases. 15 1 16 2016-10-13 Antoine Quint <graouts@apple.com> 2 17 -
trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-all-pause-locations-expected.txt
r206653 r207312 1257 1257 => 200 |a(a(), b()); 1258 1258 201 1259 202 if (o1.p1) 1260 203 a(); 1261 1262 INSERTING AT: 200:1 1263 PAUSES AT: 202:4 1264 197 var t1 = `${1} ${x=1} ${a()}`; 1265 198 var t2 = a`${1} ${x=1} ${a()}`; 1266 199 1267 -> 200 a#(a(), b()); 1268 201 1269 => 202 if (|o1.p1) 1270 203 a(); 1271 204 1272 205 if (o1["p1"]) 1273 1274 INSERTING AT: 202:5 1275 PAUSES AT: 203:4 1276 199 1277 200 a(a(), b()); 1278 201 1279 -> 202 if (o#1.p1) 1280 => 203 |a(); 1281 204 1282 205 if (o1["p1"]) 1283 206 a(); 1284 1285 INSERTING AT: 203:5 1286 PAUSES AT: 205:4 1287 200 a(a(), b()); 1288 201 1289 202 if (o1.p1) 1290 -> 203 a#(); 1291 204 1292 => 205 if (|o1["p1"]) 1293 206 a(); 1294 207 1295 208 if (String.raw`test`) 1296 1297 INSERTING AT: 205:5 1298 PAUSES AT: 206:4 1299 202 if (o1.p1) 1300 203 a(); 1301 204 1302 -> 205 if (o#1["p1"]) 1303 => 206 |a(); 1304 207 1305 208 if (String.raw`test`) 1306 209 a(); 1307 1308 INSERTING AT: 206:5 1309 PAUSES AT: 208:4 1310 203 a(); 1311 204 1312 205 if (o1["p1"]) 1313 -> 206 a#(); 1314 207 1315 => 208 if (|String.raw`test`) 1316 209 a(); 1317 210 1318 1319 INSERTING AT: 208:5 1320 PAUSES AT: 209:4 1321 205 if (o1["p1"]) 1322 206 a(); 1323 207 1324 -> 208 if (S#tring.raw`test`) 1325 => 209 |a(); 1326 210 1259 1327 1260 1328 -
trunk/LayoutTests/inspector/debugger/breakpoints/resolved-dump-each-line-expected.txt
r206653 r207312 2927 2927 => 200 |a(a(), b()); 2928 2928 201 2929 202 if (o1.p1) 2930 203 a(); 2929 2931 2930 2932 … … 2936 2938 -=> 200 |a(a(), b()); 2937 2939 201 2940 202 if (o1.p1) 2941 203 a(); 2938 2942 2939 2943 2940 2944 INSERTING AT: 201:0 2945 PAUSES AT: 202:4 2946 198 var t2 = a`${1} ${x=1} ${a()}`; 2947 199 2948 200 a(a(), b()); 2949 -> 201 # 2950 => 202 if (|o1.p1) 2951 203 a(); 2952 204 2953 205 if (o1["p1"]) 2954 2955 2956 INSERTING AT: 202:0 2957 PAUSES AT: 202:4 2958 199 2959 200 a(a(), b()); 2960 201 2961 -=> 202 #if (|o1.p1) 2962 203 a(); 2963 204 2964 205 if (o1["p1"]) 2965 2966 2967 INSERTING AT: 203:0 2968 PAUSES AT: 203:4 2969 200 a(a(), b()); 2970 201 2971 202 if (o1.p1) 2972 -=> 203 # |a(); 2973 204 2974 205 if (o1["p1"]) 2975 206 a(); 2976 2977 2978 INSERTING AT: 204:0 2979 PAUSES AT: 205:4 2980 201 2981 202 if (o1.p1) 2982 203 a(); 2983 -> 204 # 2984 => 205 if (|o1["p1"]) 2985 206 a(); 2986 207 2987 208 if (String.raw`test`) 2988 2989 2990 INSERTING AT: 205:0 2991 PAUSES AT: 205:4 2992 202 if (o1.p1) 2993 203 a(); 2994 204 2995 -=> 205 #if (|o1["p1"]) 2996 206 a(); 2997 207 2998 208 if (String.raw`test`) 2999 3000 3001 INSERTING AT: 206:0 3002 PAUSES AT: 206:4 3003 203 a(); 3004 204 3005 205 if (o1["p1"]) 3006 -=> 206 # |a(); 3007 207 3008 208 if (String.raw`test`) 3009 209 a(); 3010 3011 3012 INSERTING AT: 207:0 3013 PAUSES AT: 208:4 3014 204 3015 205 if (o1["p1"]) 3016 206 a(); 3017 -> 207 # 3018 => 208 if (|String.raw`test`) 3019 209 a(); 3020 210 3021 3022 3023 INSERTING AT: 208:0 3024 PAUSES AT: 208:4 3025 205 if (o1["p1"]) 3026 206 a(); 3027 207 3028 -=> 208 #if (|String.raw`test`) 3029 209 a(); 3030 210 3031 3032 3033 INSERTING AT: 209:0 3034 PAUSES AT: 209:4 3035 206 a(); 3036 207 3037 208 if (String.raw`test`) 3038 -=> 209 # |a(); 3039 210 3040 3041 3042 INSERTING AT: 210:0 2941 3043 PRODUCES: Could not resolve breakpoint 2942 3044 -
trunk/LayoutTests/inspector/debugger/breakpoints/resources/dump-general.js
r206653 r207312 200 200 201 201 a(a(), b()); 202 203 if (o1.p1) 204 a(); 205 206 if (o1["p1"]) 207 a(); 208 209 if (String.raw`test`) 210 a(); -
trunk/LayoutTests/inspector/debugger/stepping/stepping-misc-expected.txt
r206654 r207312 476 476 72 } 477 477 73 478 74 478 74 function entryIfWithDotExpression() { 479 479 480 480 ACTION: step-in … … 485 485 -> 72 }| 486 486 73 487 74 488 75 // FIXME: Not Yet Tested 489 490 ACTION: resume 491 RESUMED 492 PASS: Should have used all steps. 493 487 74 function entryIfWithDotExpression() { 488 75 var o = {condition: true}; 489 490 ACTION: resume 491 RESUMED 492 PASS: Should have used all steps. 493 494 -- Running test case: Debugger.stepping.IfWithDotExpression 495 EXPRESSION: setTimeout(entryIfWithDotExpression) 496 STEPS: over, in, over, resume 497 PAUSED (debugger-statement) 498 PAUSE AT entryIfWithDotExpression:77:5 499 73 500 74 function entryIfWithDotExpression() { 501 75 var o = {condition: true}; 502 -> 76 |debugger; 503 77 if (o.condition) 504 78 a(); 505 79 } 506 507 ACTION: step-over 508 PAUSE AT entryIfWithDotExpression:78:9 509 74 function entryIfWithDotExpression() { 510 75 var o = {condition: true}; 511 76 debugger; 512 -> 77 if (|o.condition) 513 78 a(); 514 79 } 515 80 516 517 ACTION: step-in 518 PAUSE AT entryIfWithDotExpression:79:9 519 75 var o = {condition: true}; 520 76 debugger; 521 77 if (o.condition) 522 -> 78 |a(); 523 79 } 524 80 525 81 function entryIfWithBracketExpression() { 526 527 ACTION: step-over 528 PAUSE AT entryIfWithDotExpression:80:2 529 76 debugger; 530 77 if (o.condition) 531 78 a(); 532 -> 79 }| 533 80 534 81 function entryIfWithBracketExpression() { 535 82 var o = {condition: true}; 536 537 ACTION: resume 538 RESUMED 539 PASS: Should have used all steps. 540 541 -- Running test case: Debugger.stepping.IfWithBracketExpression 542 EXPRESSION: setTimeout(entryIfWithBracketExpression) 543 STEPS: over, in, over, resume 544 PAUSED (debugger-statement) 545 PAUSE AT entryIfWithBracketExpression:84:5 546 80 547 81 function entryIfWithBracketExpression() { 548 82 var o = {condition: true}; 549 -> 83 |debugger; 550 84 if (o["condition"]) 551 85 a(); 552 86 } 553 554 ACTION: step-over 555 PAUSE AT entryIfWithBracketExpression:85:9 556 81 function entryIfWithBracketExpression() { 557 82 var o = {condition: true}; 558 83 debugger; 559 -> 84 if (|o["condition"]) 560 85 a(); 561 86 } 562 87 563 564 ACTION: step-in 565 PAUSE AT entryIfWithBracketExpression:86:9 566 82 var o = {condition: true}; 567 83 debugger; 568 84 if (o["condition"]) 569 -> 85 |a(); 570 86 } 571 87 572 88 function entryIfWithTaggedTemplate() { 573 574 ACTION: step-over 575 PAUSE AT entryIfWithBracketExpression:87:2 576 83 debugger; 577 84 if (o["condition"]) 578 85 a(); 579 -> 86 }| 580 87 581 88 function entryIfWithTaggedTemplate() { 582 89 debugger; 583 584 ACTION: resume 585 RESUMED 586 PASS: Should have used all steps. 587 588 -- Running test case: Debugger.stepping.IfWithTaggedTemplate 589 EXPRESSION: setTimeout(entryIfWithTaggedTemplate) 590 STEPS: over, in, over, resume 591 PAUSED (debugger-statement) 592 PAUSE AT entryIfWithTaggedTemplate:90:5 593 86 } 594 87 595 88 function entryIfWithTaggedTemplate() { 596 -> 89 |debugger; 597 90 if (String.raw`test`) 598 91 a(); 599 92 } 600 601 ACTION: step-over 602 PAUSE AT entryIfWithTaggedTemplate:91:9 603 87 604 88 function entryIfWithTaggedTemplate() { 605 89 debugger; 606 -> 90 if (|String.raw`test`) 607 91 a(); 608 92 } 609 93 610 611 ACTION: step-in 612 PAUSE AT entryIfWithTaggedTemplate:92:9 613 88 function entryIfWithTaggedTemplate() { 614 89 debugger; 615 90 if (String.raw`test`) 616 -> 91 |a(); 617 92 } 618 93 619 94 620 621 ACTION: step-over 622 PAUSE AT entryIfWithTaggedTemplate:93:2 623 89 debugger; 624 90 if (String.raw`test`) 625 91 a(); 626 -> 92 }| 627 93 628 94 629 95 // FIXME: Not Yet Tested 630 631 ACTION: resume 632 RESUMED 633 PASS: Should have used all steps. 634 -
trunk/LayoutTests/inspector/debugger/stepping/stepping-misc.html
r206652 r207312 71 71 var {x, y} = o; 72 72 var [w, z] = arr; 73 } 74 75 function entryIfWithDotExpression() { 76 var o = {condition: true}; 77 debugger; 78 if (o.condition) 79 a(); 80 } 81 82 function entryIfWithBracketExpression() { 83 var o = {condition: true}; 84 debugger; 85 if (o["condition"]) 86 a(); 87 } 88 89 function entryIfWithTaggedTemplate() { 90 debugger; 91 if (String.raw`test`) 92 a(); 73 93 } 74 94 … … 189 209 }); 190 210 211 addSteppingTestCase({ 212 name: "Debugger.stepping.IfWithDotExpression", 213 description: "Should step to the entire expression, not the dot.", 214 expression: "setTimeout(entryIfWithDotExpression)", 215 steps: [ 216 "over", 217 "in", // o.condition 218 "over", // a 219 "resume", 220 ] 221 }); 222 223 addSteppingTestCase({ 224 name: "Debugger.stepping.IfWithBracketExpression", 225 description: "Should step to the entire expression, not the bracket dot.", 226 expression: "setTimeout(entryIfWithBracketExpression)", 227 steps: [ 228 "over", 229 "in", // o["condition"] 230 "over", // a 231 "resume", 232 ] 233 }); 234 235 addSteppingTestCase({ 236 name: "Debugger.stepping.IfWithTaggedTemplate", 237 description: "Should step to the entire expression, not the template.", 238 expression: "setTimeout(entryIfWithTaggedTemplate)", 239 steps: [ 240 "over", 241 "in", // String.raw`test` 242 "over", // a 243 "resume", 244 ] 245 }); 246 191 247 loadMainPageContent().then(() => { 192 248 suite.runTestCasesAndFinish(); -
trunk/Source/JavaScriptCore/ChangeLog
r207289 r207312 1 2016-10-13 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Stepping highlight for dot/bracket expressions in if statements highlights subset of the expression 4 https://bugs.webkit.org/show_bug.cgi?id=163378 5 <rdar://problem/28749376> 6 7 Reviewed by Saam Barati. 8 9 * parser/Parser.cpp: 10 (JSC::Parser<LexerType>::parseAssignmentExpression): 11 Since each expression builds on the previous, always keep the starting 12 location the first location. 13 1 14 2016-10-13 Per Arne Vollan <pvollan@apple.com> 2 15 -
trunk/Source/JavaScriptCore/parser/Parser.cpp
r207228 r207312 4485 4485 TreeExpression property = parseExpression(context); 4486 4486 failIfFalse(property, "Cannot parse subscript expression"); 4487 base = context.createBracketAccess( location, base, property, initialAssignments != m_parserState.assignmentCount, expressionStart, expressionEnd, tokenEndPosition());4487 base = context.createBracketAccess(startLocation, base, property, initialAssignments != m_parserState.assignmentCount, expressionStart, expressionEnd, tokenEndPosition()); 4488 4488 4489 4489 if (UNLIKELY(baseIsSuper && currentScope()->isArrowFunction())) … … 4543 4543 nextExpectIdentifier(LexerFlagsIgnoreReservedWords | TreeBuilder::DontBuildKeywords); 4544 4544 matchOrFail(IDENT, "Expected a property name after '.'"); 4545 base = context.createDotAccess( location, base, m_token.m_data.ident, expressionStart, expressionEnd, tokenEndPosition());4545 base = context.createDotAccess(startLocation, base, m_token.m_data.ident, expressionStart, expressionEnd, tokenEndPosition()); 4546 4546 if (UNLIKELY(baseIsSuper && currentScope()->isArrowFunction())) 4547 4547 currentFunctionScope()->setInnerArrowFunctionUsesSuperProperty(); … … 4555 4555 typename TreeBuilder::TemplateLiteral templateLiteral = parseTemplateLiteral(context, LexerType::RawStringsBuildMode::BuildRawStrings); 4556 4556 failIfFalse(templateLiteral, "Cannot parse template literal"); 4557 base = context.createTaggedTemplate( location, base, templateLiteral, expressionStart, expressionEnd, lastTokenEndPosition());4557 base = context.createTaggedTemplate(startLocation, base, templateLiteral, expressionStart, expressionEnd, lastTokenEndPosition()); 4558 4558 m_parserState.nonLHSCount = nonLHSCount; 4559 4559 break;
Note: See TracChangeset
for help on using the changeset viewer.