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(); |
} |
/** |