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

Unified Diff: sdk/lib/_internal/compiler/js_lib/debugger_patch.dart

Issue 1121293003: Provide a dart2js implementation of dart:debugger (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review fixes 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 | sdk/lib/_internal/libraries.dart » ('j') | sdk/lib/debugger/debugger.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/debugger_patch.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/debugger_patch.dart b/sdk/lib/_internal/compiler/js_lib/debugger_patch.dart
new file mode 100644
index 0000000000000000000000000000000000000000..cde47c4d3d7a7fa93febcc6217b4998da0572a20
--- /dev/null
+++ b/sdk/lib/_internal/compiler/js_lib/debugger_patch.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2015, 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.
+
+// Patch file for dart:debugger library.
+
+import 'dart:_js_helper' show patch;
+import 'dart:_foreign_helper' show JS;
+
+@patch class Debugger {
+ /// Stop the program as if a breakpoint where hit at the following statement.
+ /// NOTE: When invoked, the isolate will not return until a debugger
+ /// continues execution. When running in the Dart VM the behaviour is the same
+ /// regardless of whether or not a debugger is connected. When compiled to
+ /// JavaScript, this uses the "debugger" statement, and behaves exactly as
+ /// that does.
+ @patch
+ @ForceInline()
+ static void breakHere() {
+ JS('', 'debugger');
+ }
+
+ /// If [expr] is true, stop the program as if a breakpoint where hit at the
+ /// following statement. See [breakHere].
+ @patch
+ @ForceInline()
+ static void breakHereIf(bool expr) {
+ if (expr) {
+ breakHere();
+ }
+ }
+}
« no previous file with comments | « no previous file | sdk/lib/_internal/libraries.dart » ('j') | sdk/lib/debugger/debugger.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698