OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library debugger_page_element; | 5 library debugger_page_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:svg'; | 8 import 'dart:svg'; |
9 import 'dart:html'; | 9 import 'dart:html'; |
10 import 'dart:math'; | 10 import 'dart:math'; |
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1800 // TODO(turnidge): Implement real command line history. | 1800 // TODO(turnidge): Implement real command line history. |
1801 String lastCommand; | 1801 String lastCommand; |
1802 | 1802 |
1803 Future run(String command) { | 1803 Future run(String command) { |
1804 if (command == '' && lastCommand != null) { | 1804 if (command == '' && lastCommand != null) { |
1805 command = lastCommand; | 1805 command = lastCommand; |
1806 } | 1806 } |
1807 console.printBold('\$ $command'); | 1807 console.printBold('\$ $command'); |
1808 return cmd.runCommand(command).then((_) { | 1808 return cmd.runCommand(command).then((_) { |
1809 lastCommand = command; | 1809 lastCommand = command; |
1810 }).catchError((e, s) { | 1810 }).catchError( |
1811 if (e is S.NetworkRpcException) { | 1811 (e, s) { |
1812 console.printRed('Unable to execute command because the connection ' | 1812 console.printRed('Unable to execute command because the connection ' |
1813 'to the VM has been closed'); | 1813 'to the VM has been closed'); |
1814 } else { | 1814 }, test: (e) => e is S.NetworkRpcException |
| 1815 ).catchError( |
| 1816 (e, s) { |
| 1817 console.printRed(e.toString()); |
| 1818 }, test: (e) => e is CommandException |
| 1819 ).catchError( |
| 1820 (e, s) { |
1815 if (s != null) { | 1821 if (s != null) { |
1816 console.printRed('Internal error: $e\n$s'); | 1822 console.printRed('Internal error: $e\n$s'); |
1817 } else { | 1823 } else { |
1818 console.printRed('Internal error: $e\n'); | 1824 console.printRed('Internal error: $e\n'); |
1819 } | 1825 } |
1820 } | 1826 } |
1821 }); | 1827 ); |
1822 } | 1828 } |
1823 | 1829 |
1824 String historyPrev(String command) { | 1830 String historyPrev(String command) { |
1825 return cmd.historyPrev(command); | 1831 return cmd.historyPrev(command); |
1826 } | 1832 } |
1827 | 1833 |
1828 String historyNext(String command) { | 1834 String historyNext(String command) { |
1829 return cmd.historyNext(command); | 1835 return cmd.historyNext(command); |
1830 } | 1836 } |
1831 | 1837 |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3257 ..setAttribute('height', '24') | 3263 ..setAttribute('height', '24') |
3258 ..children = [ | 3264 ..children = [ |
3259 new PathElement() | 3265 new PathElement() |
3260 ..setAttribute( | 3266 ..setAttribute( |
3261 'd', | 3267 'd', |
3262 'M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 ' | 3268 'M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 ' |
3263 '10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 ' | 3269 '10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 ' |
3264 '0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 ' | 3270 '0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 ' |
3265 '9h2V7h-2v2z') | 3271 '9h2V7h-2v2z') |
3266 ]; | 3272 ]; |
OLD | NEW |