| OLD | NEW |
| 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 var obj = {} | 6 var obj = {} |
| 7 Object.defineProperty(obj, 'foo', {enumerable: true, get: function() { return {a
:1,b:2}; }}); | 7 Object.defineProperty(obj, "foo", {enumerable: true, get: function() { return {a
:1,b:2}; }}); |
| 8 Object.defineProperty(obj, 'bar', {enumerable: false, set: function(x) { this.ba
z = x; }}); | 8 Object.defineProperty(obj, "bar", {enumerable: false, set: function(x) { this.ba
z = x; }}); |
| 9 | 9 |
| 10 var arr = []; | 10 var arr = []; |
| 11 Object.defineProperty(arr, 0, {enumerable: true, get: function() { return 1; }})
; | 11 Object.defineProperty(arr, 0, {enumerable: true, get: function() { return 1; }})
; |
| 12 Object.defineProperty(arr, 1, {enumerable: false, set: function(x) { this.baz =
x; }}); | 12 Object.defineProperty(arr, 1, {enumerable: false, set: function(x) { this.baz =
x; }}); |
| 13 |
| 14 var myError = new Error("myError"); |
| 15 myError.stack = "custom stack"; |
| 16 var objWithGetterExceptions = { |
| 17 get error() { throw myError }, |
| 18 get string() { throw "myString" }, |
| 19 get number() { throw 123 }, |
| 20 get function() { throw function() {} }, |
| 21 }; |
| 22 |
| 13 function logObject() | 23 function logObject() |
| 14 { | 24 { |
| 15 console.log(obj); | 25 console.log(obj); |
| 16 console.log(arr); | 26 console.log(arr); |
| 27 console.log(objWithGetterExceptions); |
| 17 } | 28 } |
| 18 | 29 |
| 19 function test() | 30 function test() |
| 20 { | 31 { |
| 21 InspectorTest.evaluateInPage("logObject()", step2); | 32 InspectorTest.evaluateInPage("logObject()", step2); |
| 22 function step2() | 33 function step2() |
| 23 { | 34 { |
| 24 InspectorTest.dumpConsoleMessages(); | 35 InspectorTest.dumpConsoleMessages(); |
| 25 step3(); | 36 step3(); |
| 26 } | 37 } |
| 27 function step3() | 38 function step3() |
| 28 { | 39 { |
| 29 InspectorTest.expandConsoleMessages(step4); | 40 InspectorTest.expandConsoleMessages(step4); |
| 30 } | 41 } |
| 31 function step4() | 42 function step4() |
| 32 { | 43 { |
| 33 InspectorTest.expandGettersInConsoleMessages(step5); | 44 InspectorTest.expandGettersInConsoleMessages(step5); |
| 34 } | 45 } |
| 35 function step5() | 46 function step5() |
| 36 { | 47 { |
| 37 InspectorTest.dumpConsoleMessages(); | 48 InspectorTest.dumpConsoleMessages(false, true); |
| 38 InspectorTest.completeTest(); | 49 InspectorTest.completeTest(); |
| 39 } | 50 } |
| 40 } | 51 } |
| 41 </script> | 52 </script> |
| 42 </head> | 53 </head> |
| 43 | 54 |
| 44 <body onload="runTest()"> | 55 <body onload="runTest()"> |
| 45 <p> | 56 <p> |
| 46 Tests that console logging dumps object values defined by getters and allows to
expand it. | 57 Tests that console logging dumps object values defined by getters and allows to
expand it. |
| 47 </p> | 58 </p> |
| 48 </body> | 59 </body> |
| 49 </html> | 60 </html> |
| OLD | NEW |