| 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_MODIFIERS)class Console { | 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class Console { |
| 8 | 8 |
| 9 static Console _safeConsole = new Console(); | 9 Console._safe() {} |
| 10 |
| 11 static Console _safeConsole = new Console._safe(); |
| 10 | 12 |
| 11 bool get _isConsoleDefined => JS('bool', 'typeof console != "undefined"'); | 13 bool get _isConsoleDefined => JS('bool', 'typeof console != "undefined"'); |
| 12 | 14 |
| 13 @DomName('Console.memory') | 15 @DomName('Console.memory') |
| 14 MemoryInfo get memory => _isConsoleDefined ? | 16 MemoryInfo get memory => _isConsoleDefined ? |
| 15 JS('MemoryInfo', 'console.memory') : null; | 17 JS('MemoryInfo', 'console.memory') : null; |
| 16 | 18 |
| 17 @DomName('Console.assertCondition') | 19 @DomName('Console.assertCondition') |
| 18 void assertCondition(bool condition, Object arg) => _isConsoleDefined ? | 20 void assertCondition(bool condition, Object arg) => _isConsoleDefined ? |
| 19 JS('void', 'console.assertCondition(#, #)', condition, arg) : null; | 21 JS('void', 'console.assertCondition(#, #)', condition, arg) : null; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 86 |
| 85 @DomName('Console.trace') | 87 @DomName('Console.trace') |
| 86 void trace(Object arg) => _isConsoleDefined ? | 88 void trace(Object arg) => _isConsoleDefined ? |
| 87 JS('void', 'console.trace(#)', arg) : null; | 89 JS('void', 'console.trace(#)', arg) : null; |
| 88 | 90 |
| 89 @DomName('Console.warn') | 91 @DomName('Console.warn') |
| 90 void warn(Object arg) => _isConsoleDefined ? | 92 void warn(Object arg) => _isConsoleDefined ? |
| 91 JS('void', 'console.warn(#)', arg) : null; | 93 JS('void', 'console.warn(#)', arg) : null; |
| 92 $!MEMBERS | 94 $!MEMBERS |
| 93 } | 95 } |
| OLD | NEW |