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

Side by Side Diff: dart/sdk/lib/_internal/lib/js_primitives.dart

Issue 204483002: Add 'breakpoint' similar to 'debugger' from JavaScript. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// dart2js "primitives", that is, features that cannot be implemented without 5 /// dart2js "primitives", that is, features that cannot be implemented without
6 /// access to JavaScript features. 6 /// access to JavaScript features.
7 library dart2js._js_primitives; 7 library dart2js._js_primitives;
8 8
9 import 'dart:_foreign_helper' show 9 import 'dart:_foreign_helper' show
10 JS; 10 JS;
(...skipping 30 matching lines...) Expand all
41 if (JS('bool', r'typeof print == "function"')) { 41 if (JS('bool', r'typeof print == "function"')) {
42 JS('void', r'print(#)', string); 42 JS('void', r'print(#)', string);
43 return; 43 return;
44 } 44 }
45 45
46 // This is somewhat nasty, but we don't want to drag in a bunch of 46 // This is somewhat nasty, but we don't want to drag in a bunch of
47 // dependencies to handle a situation that cannot happen. So we 47 // dependencies to handle a situation that cannot happen. So we
48 // avoid using Dart [:throw:] and Dart [toString]. 48 // avoid using Dart [:throw:] and Dart [toString].
49 JS('void', 'throw "Unable to print message: " + String(#)', string); 49 JS('void', 'throw "Unable to print message: " + String(#)', string);
50 } 50 }
51
52 void breakpoint() {
53 JS('void', 'debugger');
54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698