Chromium Code Reviews

Side by Side Diff: Source/bindings/core/v8/DebuggerScript.js

Issue 694753002: DevTools: Show preview for ES6 MapIterator, SetIterator in console. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 67 matching lines...)
78 for (var i = 0; i < count; i++) { 78 for (var i = 0; i < count; i++) {
79 var scopeDetails = mirror.scope(i).details(); 79 var scopeDetails = mirror.scope(i).details();
80 result[i] = { 80 result[i] = {
81 type: scopeDetails.type(), 81 type: scopeDetails.type(),
82 object: DebuggerScript._buildScopeObject(scopeDetails.type(), scopeD etails.object()) 82 object: DebuggerScript._buildScopeObject(scopeDetails.type(), scopeD etails.object())
83 }; 83 };
84 } 84 }
85 return result; 85 return result;
86 } 86 }
87 87
88 DebuggerScript.getCollectionEntries = function(object) 88 DebuggerScript.getCollectionEntries = function(object)
yurys 2014/11/10 07:38:03 We should pick a better name for the method as not
89 { 89 {
90 var mirror = MakeMirror(object, true /* transient */); 90 var mirror = MakeMirror(object, true /* transient */);
91 if (mirror.isMap()) 91 if (mirror.isMap())
92 return mirror.entries(); 92 return mirror.entries();
93 if (mirror.isSet()) { 93 if (mirror.isSet() || mirror.isIterator()) {
94 var result = []; 94 var result = [];
95 var values = mirror.values(); 95 var values = mirror.isSet() ? mirror.values() : mirror.preview();
96 for (var i = 0; i < values.length; ++i) 96 for (var i = 0; i < values.length; ++i)
97 result.push({ value: values[i] }); 97 result.push({ value: values[i] });
98 return result; 98 return result;
99 } 99 }
100 } 100 }
101 101
102 DebuggerScript.getInternalProperties = function(value) 102 DebuggerScript.getInternalProperties = function(value)
103 { 103 {
104 var properties = ObjectMirror.GetInternalProperties(value); 104 var properties = ObjectMirror.GetInternalProperties(value);
105 var result = []; 105 var result = [];
(...skipping 433 matching lines...)
539 "parentPromise": eventData.parentPromise().value(), 539 "parentPromise": eventData.parentPromise().value(),
540 "status": eventData.status() 540 "status": eventData.status()
541 }; 541 };
542 } 542 }
543 543
544 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it. 544 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it.
545 ToggleMirrorCache(false); 545 ToggleMirrorCache(false);
546 546
547 return DebuggerScript; 547 return DebuggerScript;
548 })(); 548 })();
OLDNEW

Powered by Google App Engine