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

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 1129423003: Fix reload() for VM object (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 98a128b06ed86ea9a92b296de83aa854877c4fc4..e9f9b867f92afc7cff97b58c20a65203b85eff61 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -281,10 +281,13 @@ abstract class ServiceObject extends Observable {
Future<ServiceObject> reload() {
// TODO(turnidge): Checking for a null id should be part of the
// "immmutable" check.
- if (id == null || id == '') {
- return new Future.value(this);
- }
- if (loaded && immutable) {
+ bool hasId = (id != null) && (id != '');
+ bool isVM = this is VM;
+ // We should always reload the VM.
+ // We can't reload objects without an id.
+ // We shouldn't reload an immutable and already loaded object.
+ bool skipLoad = !isVM && (!hasId || (immutable && loaded));
+ if (skipLoad) {
return new Future.value(this);
}
if (_inProgressReload == null) {
@@ -2369,7 +2372,7 @@ class Script extends ServiceObject with Coverage {
if (lastLine == null) {
return r;
}
-
+
final lastColumn = tokenToCol(endTokenPos);
if (lastColumn == null) {
return r;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698