OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 |
| 6 /// Tests that dart2js allows to import dart:io for web clients, but it |
| 7 /// continues to indicate that it is not supported (so config-specific imports |
| 8 /// continue to have the same semantics as before). |
| 9 library unconditional_dartio_import_test; |
| 10 |
| 11 import 'dart:io' as io; // import is allowed! |
| 12 import 'package:expect/expect.dart'; |
| 13 |
| 14 main() { |
| 15 // their APIs throw: |
| 16 Expect.throws(() => new io.File('name').existsSync()); |
| 17 |
| 18 // ... but environment variable will indicate it is not supported. |
| 19 Expect.isFalse(const bool.fromEnvironment('dart.library.io')); |
| 20 } |
OLD | NEW |