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 | 13 |
| 14 var myError = new Error("myError"); |
| 15 myError.stack = "custom stack"; |
14 var objWithGetterExceptions = { | 16 var objWithGetterExceptions = { |
15 get error() { throw new Error('myError') }, | 17 get error() { throw myError }, |
16 get string() { throw 'myString' }, | 18 get string() { throw "myString" }, |
17 get number() { throw 123 }, | 19 get number() { throw 123 }, |
18 get function() { throw function() {} }, | 20 get function() { throw function() {} }, |
19 }; | 21 }; |
20 | 22 |
21 function logObject() | 23 function logObject() |
22 { | 24 { |
23 console.log(obj); | 25 console.log(obj); |
24 console.log(arr); | 26 console.log(arr); |
25 console.log(objWithGetterExceptions); | 27 console.log(objWithGetterExceptions); |
26 } | 28 } |
(...skipping 22 matching lines...) Expand all Loading... |
49 } | 51 } |
50 </script> | 52 </script> |
51 </head> | 53 </head> |
52 | 54 |
53 <body onload="runTest()"> | 55 <body onload="runTest()"> |
54 <p> | 56 <p> |
55 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. |
56 </p> | 58 </p> |
57 </body> | 59 </body> |
58 </html> | 60 </html> |
OLD | NEW |