| 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 library dart._debugger; | 5 library dart._debugger; |
| 6 | 6 |
| 7 import 'dart:_foreign_helper' show JS; | 7 import 'dart:_foreign_helper' show JS; |
| 8 import 'dart:_interceptors' show JSArray; |
| 8 import 'dart:_runtime' as dart; | 9 import 'dart:_runtime' as dart; |
| 9 import 'dart:core'; | 10 import 'dart:core'; |
| 10 import 'dart:collection'; | 11 import 'dart:collection'; |
| 11 import 'dart:html' as html; | 12 import 'dart:html' as html; |
| 12 import 'dart:math'; | 13 import 'dart:math'; |
| 13 | 14 |
| 14 /// JsonMLConfig object to pass to devtools to specify how an Object should | 15 /// JsonMLConfig object to pass to devtools to specify how an Object should |
| 15 /// be displayed. skipDart signals that an object should not be formatted | 16 /// be displayed. skipDart signals that an object should not be formatted |
| 16 /// by the Dart formatter. This is used to specify that an Object | 17 /// by the Dart formatter. This is used to specify that an Object |
| 17 /// should just be displayed using the regular JavaScript view instead of a | 18 /// should just be displayed using the regular JavaScript view instead of a |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 static const skipDart = const JsonMLConfig("skipDart"); | 30 static const skipDart = const JsonMLConfig("skipDart"); |
| 30 static const keyToString = const JsonMLConfig("keyToString"); | 31 static const keyToString = const JsonMLConfig("keyToString"); |
| 31 static const asClass = const JsonMLConfig("asClass"); | 32 static const asClass = const JsonMLConfig("asClass"); |
| 32 } | 33 } |
| 33 | 34 |
| 34 int _maxSpanLength = 100; | 35 int _maxSpanLength = 100; |
| 35 var _devtoolsFormatter = new JsonMLFormatter(new DartFormatter()); | 36 var _devtoolsFormatter = new JsonMLFormatter(new DartFormatter()); |
| 36 | 37 |
| 37 String _typeof(object) => JS('String', 'typeof #', object); | 38 String _typeof(object) => JS('String', 'typeof #', object); |
| 38 | 39 |
| 39 List<String> getOwnPropertyNames(object) => JS('List<String>', | 40 List<String> getOwnPropertyNames(object) => |
| 40 'dart.list(Object.getOwnPropertyNames(#), #)', object, String); | 41 new JSArray<String>.of(dart.getOwnPropertyNames(object)); |
| 41 | 42 |
| 42 List getOwnPropertySymbols(object) => | 43 List getOwnPropertySymbols(object) => |
| 43 JS('List', 'Object.getOwnPropertySymbols(#)', object); | 44 JS('List', 'Object.getOwnPropertySymbols(#)', object); |
| 44 | 45 |
| 45 // TODO(jacobr): move this to dart:js and fully implement. | 46 // TODO(jacobr): move this to dart:js and fully implement. |
| 46 class JSNative { | 47 class JSNative { |
| 47 // Name may be a String or a Symbol. | 48 // Name may be a String or a Symbol. |
| 48 static getProperty(object, name) => JS('', '#[#]', object, name); | 49 static getProperty(object, name) => JS('', '#[#]', object, name); |
| 49 // Name may be a String or a Symbol. | 50 // Name may be a String or a Symbol. |
| 50 static setProperty(object, name, value) => | 51 static setProperty(object, name, value) => |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 // If export worked for private SDK libraries we could just export | 880 // If export worked for private SDK libraries we could just export |
| 880 // these methods from dart:_runtime. | 881 // these methods from dart:_runtime. |
| 881 | 882 |
| 882 getModuleNames() { | 883 getModuleNames() { |
| 883 return dart.getModuleNames(); | 884 return dart.getModuleNames(); |
| 884 } | 885 } |
| 885 | 886 |
| 886 getModuleLibraries(String name) { | 887 getModuleLibraries(String name) { |
| 887 return dart.getModuleLibraries(name); | 888 return dart.getModuleLibraries(name); |
| 888 } | 889 } |
| OLD | NEW |