Dart 有 'breakpoint' 语句吗?

Does Dart have a 'breakpoint' statement?

Dart中有没有在调试时不设置断点就停止调试的语句?

在某些情况下,能够对断点进行硬编码会很有帮助。例如,我将 运行 添加到此以简化远程调试,以确保执行提前停止,然后我可以使用调试器添加更多断点。

这是刚刚介绍的 (Dart VM 版本:1.11.0-edge.131775(2015 年 6 月 2 日星期二 14:25:22)"linux_x64")

import 'dart:developer'; 

void main() {
  debugger(); 
  // or
  debugger(msg: 'because I say so');
}

还有一个条件变量

// Debugger.breakHereIf(bool expr); // current
debugger(when: somethingIsTrue, msg: 'investigate'); // later

另请参阅Breakpoints in Dartium not working了解如何使用 Dartiums 调试器。