| OLD | NEW |
| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 var funcObject = frameDetails.func(); | 345 var funcObject = frameDetails.func(); |
| 346 var sourcePosition; | 346 var sourcePosition; |
| 347 // FIXMEDART: if added purely for Dart. | 347 // FIXMEDART: if added purely for Dart. |
| 348 if (frameDetails.sourcePosition) { | 348 if (frameDetails.sourcePosition) { |
| 349 sourcePosition = frameDetails.sourcePosition(); | 349 sourcePosition = frameDetails.sourcePosition(); |
| 350 } | 350 } |
| 351 var thisObject = frameDetails.receiver(); | 351 var thisObject = frameDetails.receiver(); |
| 352 | 352 |
| 353 var isAtReturn = !!frameDetails.isAtReturn(); | 353 var isAtReturn = !!frameDetails.isAtReturn(); |
| 354 var cachedFramePointer = frameDetails.framePointer(); |
| 354 var returnValue = isAtReturn ? frameDetails.returnValue() : undefined; | 355 var returnValue = isAtReturn ? frameDetails.returnValue() : undefined; |
| 355 | 356 |
| 356 var scopeMirrors = (scopeDetailsLevel === DebuggerScript.ScopeInfoDetails.No
Scopes ? [] : frameMirror.allScopes(scopeDetailsLevel === DebuggerScript.ScopeIn
foDetails.FastAsyncScopes)); | 357 var scopeMirrors = (scopeDetailsLevel === DebuggerScript.ScopeInfoDetails.No
Scopes ? [] : frameMirror.allScopes(scopeDetailsLevel === DebuggerScript.ScopeIn
foDetails.FastAsyncScopes)); |
| 357 var scopeTypes = new Array(scopeMirrors.length); | 358 var scopeTypes = new Array(scopeMirrors.length); |
| 358 var scopeObjects = new Array(scopeMirrors.length); | 359 var scopeObjects = new Array(scopeMirrors.length); |
| 359 for (var i = 0; i < scopeMirrors.length; ++i) { | 360 for (var i = 0; i < scopeMirrors.length; ++i) { |
| 360 var scopeDetails = scopeMirrors[i].details(); | 361 var scopeDetails = scopeMirrors[i].details(); |
| 361 scopeTypes[i] = scopeDetails.type(); | 362 scopeTypes[i] = scopeDetails.type(); |
| 362 scopeObjects[i] = scopeDetails.object(); | 363 scopeObjects[i] = scopeDetails.object(); |
| 363 } | 364 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 function sourceID() | 428 function sourceID() |
| 428 { | 429 { |
| 429 // FIXMEDART: remove caching when Dart devtools refactor CL lands. | 430 // FIXMEDART: remove caching when Dart devtools refactor CL lands. |
| 430 if (!scriptId) { | 431 if (!scriptId) { |
| 431 var script = ensureFuncMirror().script(); | 432 var script = ensureFuncMirror().script(); |
| 432 scriptId = script && script.id(); | 433 scriptId = script && script.id(); |
| 433 } | 434 } |
| 434 return scriptId; | 435 return scriptId; |
| 435 } | 436 } |
| 436 | 437 |
| 438 function framePointer() { |
| 439 return cachedFramePointer; |
| 440 } |
| 441 |
| 437 function functionName() | 442 function functionName() |
| 438 { | 443 { |
| 439 // FIXMEDART: remove caching when Dart devtools refactor CL lands. | 444 // FIXMEDART: remove caching when Dart devtools refactor CL lands. |
| 440 if (!functionNameCache) { | 445 if (!functionNameCache) { |
| 441 var func = ensureFuncMirror(); | 446 var func = ensureFuncMirror(); |
| 442 if (!func.resolved()) | 447 if (!func.resolved()) |
| 443 return undefined; | 448 return undefined; |
| 444 var displayName; | 449 var displayName; |
| 445 var valueMirror = func.property("displayName").value(); | 450 var valueMirror = func.property("displayName").value(); |
| 446 if (valueMirror && valueMirror.isString()) | 451 if (valueMirror && valueMirror.isString()) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 "functionName": functionName, | 499 "functionName": functionName, |
| 495 "thisObject": thisObject, | 500 "thisObject": thisObject, |
| 496 "scopeChain": lazyScopeChain, | 501 "scopeChain": lazyScopeChain, |
| 497 "scopeType": scopeTypes, | 502 "scopeType": scopeTypes, |
| 498 "evaluate": evaluate, | 503 "evaluate": evaluate, |
| 499 "caller": callerFrame, | 504 "caller": callerFrame, |
| 500 "restart": restart, | 505 "restart": restart, |
| 501 "setVariableValue": setVariableValue, | 506 "setVariableValue": setVariableValue, |
| 502 "stepInPositions": stepInPositions, | 507 "stepInPositions": stepInPositions, |
| 503 "isAtReturn": isAtReturn, | 508 "isAtReturn": isAtReturn, |
| 509 "framePointer": framePointer, |
| 504 "returnValue": returnValue | 510 "returnValue": returnValue |
| 505 }; | 511 }; |
| 506 } | 512 } |
| 507 | 513 |
| 508 DebuggerScript._buildScopeObject = function(scopeType, scopeObject) | 514 DebuggerScript._buildScopeObject = function(scopeType, scopeObject) |
| 509 { | 515 { |
| 510 var result; | 516 var result; |
| 511 switch (scopeType) { | 517 switch (scopeType) { |
| 512 case ScopeType.Local: | 518 case ScopeType.Local: |
| 513 case ScopeType.Closure: | 519 case ScopeType.Closure: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 534 break; | 540 break; |
| 535 } | 541 } |
| 536 return result; | 542 return result; |
| 537 } | 543 } |
| 538 | 544 |
| 539 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. | 545 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. |
| 540 ToggleMirrorCache(false); | 546 ToggleMirrorCache(false); |
| 541 | 547 |
| 542 return DebuggerScript; | 548 return DebuggerScript; |
| 543 })(); | 549 })(); |
| OLD | NEW |