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

Unified Diff: runtime/bin/vmservice/client/lib/src/elements/script_inset.dart

Issue 216883008: Use tokenPos instead of line/col in the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js / handle multiple reloads Created 6 years, 9 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
Index: runtime/bin/vmservice/client/lib/src/elements/script_inset.dart
diff --git a/runtime/bin/vmservice/client/lib/src/elements/script_inset.dart b/runtime/bin/vmservice/client/lib/src/elements/script_inset.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ba6c127d4976a57f13833b26440d861dc789e3de
--- /dev/null
+++ b/runtime/bin/vmservice/client/lib/src/elements/script_inset.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library script_inset_element;
+
+import 'observatory_element.dart';
+import 'package:observatory/service.dart';
+import 'package:polymer/polymer.dart';
+
+/// Displays an Error response.
+@CustomTag('script-inset')
+class ScriptInsetElement extends ObservatoryElement {
+ @published Script script;
+ @published int pos;
+
+ @observable List<ScriptLine> lines = toObservable([]);
+
+ void scriptChanged(oldValue) {
+ _updateProperties();
+ }
+
+ void posChanged(oldValue) {
+ _updateProperties();
+ }
+
+ void _updateProperties() {
+ if (!script.loaded) {
+ script.load().then((_) {
+ if (script.loaded) {
+ _updateProperties();
+ }
+ });
+ return;
+ }
+ notifyPropertyChange(#lines, 0, 1);
+ var lineNumber = script.tokenToLine(pos);
+ lines.clear();
+ lines.add(script.lines[lineNumber-1]);
+ }
+
+ ScriptInsetElement.created() : super.created();
+}

Powered by Google App Engine
This is Rietveld 408576698