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

Unified Diff: src/inspector/debugger-script.js

Issue 2427633002: Revert of [debug] Consistently use script from FrameMirror (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/mirrors.js ('k') | src/inspector/debugger_script_externs.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/debugger-script.js
diff --git a/src/inspector/debugger-script.js b/src/inspector/debugger-script.js
index deb875f79f410693be257070ba9674897f546394..98910d69df7167d0bb7e1ff8b9cd5b777cf6ec23 100644
--- a/src/inspector/debugger-script.js
+++ b/src/inspector/debugger-script.js
@@ -416,7 +416,6 @@
var frameDetails = frameMirror.details();
var funcObject = frameDetails.func();
- var scriptObject = frameDetails.script();
var sourcePosition = frameDetails.sourcePosition();
var thisObject = frameDetails.receiver();
@@ -449,7 +448,6 @@
// Calculated lazily.
var scopeChain;
var funcMirror;
- var scriptMirror;
var location;
/** @type {!Array<?RawLocation>} */
var scopeStartLocations;
@@ -518,7 +516,7 @@
{
if (!details) {
var scopeObjects = ensureScopeChain();
- var script = ensureScriptMirror();
+ var script = ensureFuncMirror().script();
/** @type {!Array<Scope>} */
var scopes = [];
for (var i = 0; i < scopeObjects.length; ++i) {
@@ -572,24 +570,14 @@
}
/**
- * @return {!ScriptMirror}
- */
- function ensureScriptMirror()
- {
- if (!scriptMirror) {
- scriptMirror = MakeMirror(scriptObject);
- }
- return /** @type {!ScriptMirror} */(scriptMirror);
- }
-
- /**
* @return {!{line: number, column: number}}
*/
function ensureLocation()
{
if (!location) {
- var script = ensureScriptMirror();
- location = script.locationFromPosition(sourcePosition, true);
+ var script = ensureFuncMirror().script();
+ if (script)
+ location = script.locationFromPosition(sourcePosition, true);
if (!location)
location = { line: 0, column: 0 };
}
@@ -628,12 +616,12 @@
}
/**
- * @return {number}
+ * @return {number|undefined}
*/
function sourceID()
{
- var script = ensureScriptMirror();
- return script.id();
+ var script = ensureFuncMirror().script();
+ return script && script.id();
}
/**
« no previous file with comments | « src/debug/mirrors.js ('k') | src/inspector/debugger_script_externs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698