Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Programmatically trigger breakpoints. | 5 // Patch file for dart:debugger library. |
| 6 library dart.debugger; | |
| 7 | 6 |
| 8 /// Programmatically trigger breakpoints. | 7 import 'dart:_js_helper' show patch; |
| 9 class Debugger { | 8 import 'dart:_foreign_helper' show JS; |
| 9 | |
| 10 @patch class Debugger { | |
| 10 /// Stop the program as if a breakpoint where hit at the following statement. | 11 /// Stop the program as if a breakpoint where hit at the following statement. |
| 11 /// NOTE: When invoked, the isolate will not return until a debugger | 12 /// NOTE: When invoked, the isolate will not return until a debugger |
| 12 /// continues execution. The behaviour is the same regardless of whether or | 13 /// continues execution. The behaviour is the same regardless of whether or |
| 13 /// not a debugger is connected. | 14 /// not a debugger is connected. |
|
skybrian
2015/05/05 19:35:38
The last statement isn't true for the JavaScript "
sra1
2015/05/06 04:33:10
+1
Alan Knight
2015/05/06 17:04:39
Done.
| |
| 15 @patch | |
| 14 static void breakHere() { | 16 static void breakHere() { |
|
floitsch
2015/05/05 20:29:28
The _js_helper library has a "ForceInline()" annot
Alan Knight
2015/05/06 17:04:39
Done.
| |
| 15 print('Debugger.breakHere not supported on this platform.'); | 17 JS('', 'debugger'); |
| 16 } | 18 } |
| 17 | 19 |
| 18 /// If [expr] is true, stop the program as if a breakpoint where hit at the | 20 /// If [expr] is true, stop the program as if a breakpoint where hit at the |
| 19 /// following statement. | 21 /// following statement. |
| 22 @patch | |
| 20 static void breakHereIf(bool expr) { | 23 static void breakHereIf(bool expr) { |
|
floitsch
2015/05/05 20:29:28
ditto.
Alan Knight
2015/05/06 17:04:38
Done.
| |
| 21 print('Debugger.breakHereIf not supported on this platform.'); | 24 if (expr) { |
| 25 breakHere(); | |
| 26 } | |
| 22 } | 27 } |
| 23 } | 28 } |
| OLD | NEW |