Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/console/console-eval-object-literal.html

Issue 1875903002: [DevTools] Better heuristic for detecting object literals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script> 4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script> 5 <script>
6 function test() 6 function test()
7 { 7 {
8 var commands = ["{a:1, b:2}", "{a:1}", "{var a = 1; eval(\"{a :1, b:2 }\");} ", "{ for (var i = 0; i < 5; ++i); }"]; 8 var commands = [
9 "{a:1, b:2}",
10 "{a:1}",
11 "{var a = 1; eval(\"{ a:1, b:2 }\");}",
12 "{ for (var i = 0; i < 5; ++i); }",
13 "{ a: 4 }),({ b: 7 }",
14 "{ let a = 4; a; }",
15 "{ let a = 4; }; { let b = 5; };",
16 "{ a: 4 } + { a: 5 }",
17 "{ a: 4 }, { a: 5 }",
18
19 // Test that detection doesn't incur side effects.
20 "var foo = 4;",
21 "{ a: foo++ }",
22 "foo;"
23 ];
9 var current = -1; 24 var current = -1;
10 loopOverCommands(); 25 loopOverCommands();
11 function loopOverCommands() 26 function loopOverCommands()
12 { 27 {
13 ++current; 28 ++current;
14 if (current < commands.length) { 29 if (current < commands.length) {
15 InspectorTest.evaluateInConsole(commands[current], loopOverCommands) ; 30 InspectorTest.evaluateInConsole(commands[current], loopOverCommands) ;
16 } else { 31 } else {
17 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames(); 32 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames();
18 InspectorTest.completeTest(); 33 InspectorTest.completeTest();
19 } 34 }
20 } 35 }
21 } 36 }
22 </script> 37 </script>
23 </head> 38 </head>
24 <body onload="runTest()"> 39 <body onload="runTest()">
25 <p> 40 <p>
26 Tests that evaluating object literal in the console correctly reported. 41 Tests that evaluating object literal in the console correctly reported.
27 </p> 42 </p>
28 </body> 43 </body>
29 </html> 44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698