[JSC] Web Inspector: CRASH running $0, $1, etc before they are set
[WebKit-https.git] / LayoutTests / inspector / console / command-line-api.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/elements-test.js"></script>
5 <script>
6
7 var test = function()
8 {
9     var expressions = [
10         "$0.toString()",
11         "$3",
12         "keys([3,4]).toString()",
13         "values([3,4]).toString()",
14         "$('foo').toString()",
15         "$$('p#foo').toString()"
16     ];
17
18     InspectorTest.selectNodeWithId("foo", step1);
19
20     function step1(node)
21     {
22         if (!expressions.length) {
23             InspectorTest.completeTest();
24             return;
25         }
26         var expression = expressions[0];
27         expressions.splice(0, 1);
28         InspectorTest.evaluateInConsoleAndDump(expression, step1);
29     }
30 }
31
32 </script>
33 </head>
34
35 <body onload="runTest()">
36 <p id="foo">
37 Tests that command line api works.
38 </p>
39
40 </body>
41 </html>