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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js

Issue 2112673003: [DevTools] Move suspended generator location to internal properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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 /* 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 type: /** @type {string} */(DebuggerScript._scopeTypeNames.get(scope Details.type())), 85 type: /** @type {string} */(DebuggerScript._scopeTypeNames.get(scope Details.type())),
86 object: scopeObject, 86 object: scopeObject,
87 name: scopeDetails.name() || "" 87 name: scopeDetails.name() || ""
88 }); 88 });
89 } 89 }
90 return result; 90 return result;
91 } 91 }
92 92
93 /** 93 /**
94 * @param {Object} object 94 * @param {Object} object
95 * @return {?GeneratorObjectDetails} 95 * @return {?RawLocation}
96 */ 96 */
97 DebuggerScript.getGeneratorObjectDetails = function(object) 97 DebuggerScript.getGeneratorObjectLocation = function(object)
98 { 98 {
99 var mirror = MakeMirror(object, true /* transient */); 99 var mirror = MakeMirror(object, true /* transient */);
100 if (!mirror.isGenerator()) 100 if (!mirror.isGenerator())
101 return null; 101 return null;
102 var generatorMirror = /** @type {!GeneratorMirror} */(mirror); 102 var generatorMirror = /** @type {!GeneratorMirror} */(mirror);
103 var funcMirror = generatorMirror.func(); 103 var funcMirror = generatorMirror.func();
104 if (!funcMirror.resolved()) 104 if (!funcMirror.resolved())
105 return null; 105 return null;
106 var result = { 106 var location = generatorMirror.sourceLocation() || funcMirror.sourceLocation ();
107 "function": funcMirror.value(),
108 "functionName": funcMirror.debugName(),
109 "status": generatorMirror.status()
110 };
111 var script = funcMirror.script(); 107 var script = funcMirror.script();
112 var location = generatorMirror.sourceLocation() || funcMirror.sourceLocation ();
113 if (script && location) { 108 if (script && location) {
114 result["location"] = { 109 return {
115 "scriptId": String(script.id()), 110 scriptId: "" + script.id(),
116 "lineNumber": location.line, 111 lineNumber: location.line,
117 "columnNumber": location.column 112 columnNumber: location.column
118 }; 113 };
119 } 114 }
120 return result; 115 return null;
121 } 116 }
122 117
123 /** 118 /**
124 * @param {Object} object 119 * @param {Object} object
125 * @return {!Array<!{value: *}>|undefined} 120 * @return {!Array<!{value: *}>|undefined}
126 */ 121 */
127 DebuggerScript.getCollectionEntries = function(object) 122 DebuggerScript.getCollectionEntries = function(object)
128 { 123 {
129 var mirror = MakeMirror(object, true /* transient */); 124 var mirror = MakeMirror(object, true /* transient */);
130 if (mirror.isMap()) 125 if (mirror.isMap())
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 break; 691 break;
697 } 692 }
698 return result; 693 return result;
699 } 694 }
700 695
701 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it. 696 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it.
702 ToggleMirrorCache(false); 697 ToggleMirrorCache(false);
703 698
704 return DebuggerScript; 699 return DebuggerScript;
705 })(); 700 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698