mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 02:17:14 +00:00
Provide a dart2js implementation of dart:debugger
BUG= R=sra@google.com Review URL: https://codereview.chromium.org//1121293003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45577 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
37feb0c855
commit
6fe25b0578
32
sdk/lib/_internal/compiler/js_lib/debugger_patch.dart
Normal file
32
sdk/lib/_internal/compiler/js_lib/debugger_patch.dart
Normal file
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -56,7 +56,8 @@ const Map<String, LibraryInfo> LIBRARIES = const {
|
|||
|
||||
"debugger": const LibraryInfo(
|
||||
"debugger/debugger.dart",
|
||||
maturity: Maturity.UNSTABLE),
|
||||
maturity: Maturity.UNSTABLE,
|
||||
dart2jsPatchPath: "_internal/compiler/js_lib/debugger_patch.dart"),
|
||||
|
||||
"html": const LibraryInfo(
|
||||
"html/dartium/html_dartium.dart",
|
||||
|
|
|
@ -11,13 +11,9 @@ class Debugger {
|
|||
/// NOTE: When invoked, the isolate will not return until a debugger
|
||||
/// continues execution. The behaviour is the same regardless of whether or
|
||||
/// not a debugger is connected.
|
||||
static void breakHere() {
|
||||
print('Debugger.breakHere not supported on this platform.');
|
||||
}
|
||||
external static void breakHere();
|
||||
|
||||
/// If [expr] is true, stop the program as if a breakpoint where hit at the
|
||||
/// following statement.
|
||||
static void breakHereIf(bool expr) {
|
||||
print('Debugger.breakHereIf not supported on this platform.');
|
||||
}
|
||||
external static void breakHereIf(bool expr);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue