| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 $(ANNOTATIONS)class Console { | 7 $(ANNOTATIONS)class Console { |
| 8 | 8 |
| 9 static Console safeConsole = new Console(); | 9 static Console safeConsole = new Console(); |
| 10 | 10 |
| 11 bool get _isConsoleDefined => JS('bool', 'typeof console != "undefined"'); | 11 bool get _isConsoleDefined => JS('bool', 'typeof console != "undefined"'); |
| 12 | 12 |
| 13 @DomName('Console.memory') | 13 @DomName('Console.memory') |
| 14 MemoryInfo get memory => _isConsoleDefined ? | 14 MemoryInfo get memory => _isConsoleDefined ? |
| 15 JS('MemoryInfo', 'console.memory') : null; | 15 JS('MemoryInfo', 'console.memory') : null; |
| 16 | 16 |
| 17 /* | |
| 18 @DomName('Console.profiles') | 17 @DomName('Console.profiles') |
| 19 List<ScriptProfile> get profiles => _isConsoleDefined ? | 18 List<ScriptProfile> get profiles => _isConsoleDefined ? |
| 20 JS('List<ScriptProfile>', 'console.profiles') : null; | 19 JS('List<ScriptProfile>', 'console.profiles') : null; |
| 21 */ | |
| 22 | 20 |
| 23 @DomName('Console.assertCondition') | 21 @DomName('Console.assertCondition') |
| 24 void assertCondition(bool condition, Object arg) => _isConsoleDefined ? | 22 void assertCondition(bool condition, Object arg) => _isConsoleDefined ? |
| 25 JS('void', 'console.assertCondition(#, #)', condition, arg) : null; | 23 JS('void', 'console.assertCondition(#, #)', condition, arg) : null; |
| 26 | 24 |
| 27 @DomName('Console.count') | 25 @DomName('Console.count') |
| 28 void count(Object arg) => _isConsoleDefined ? | 26 void count(Object arg) => _isConsoleDefined ? |
| 29 JS('void', 'console.count(#)', arg) : null; | 27 JS('void', 'console.count(#)', arg) : null; |
| 30 | 28 |
| 31 @DomName('Console.debug') | 29 @DomName('Console.debug') |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 88 |
| 91 @DomName('Console.trace') | 89 @DomName('Console.trace') |
| 92 void trace(Object arg) => _isConsoleDefined ? | 90 void trace(Object arg) => _isConsoleDefined ? |
| 93 JS('void', 'console.trace(#)', arg) : null; | 91 JS('void', 'console.trace(#)', arg) : null; |
| 94 | 92 |
| 95 @DomName('Console.warn') | 93 @DomName('Console.warn') |
| 96 void warn(Object arg) => _isConsoleDefined ? | 94 void warn(Object arg) => _isConsoleDefined ? |
| 97 JS('void', 'console.warn(#)', arg) : null; | 95 JS('void', 'console.warn(#)', arg) : null; |
| 98 $!MEMBERS | 96 $!MEMBERS |
| 99 } | 97 } |
| OLD | NEW |