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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/console/console-log-object-with-getter.html

Issue 2629073004: ac (Closed)
Patch Set: Created 3 years, 11 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 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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698