Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import "dart:async"; | |
| 6 import 'package:expect/expect.dart'; | |
| 5 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
| 6 import 'package:expect/expect.dart'; | |
| 7 | 8 |
| 8 import 'dart:async'; | 9 // This library contains a member loadLibrary. |
| 10 // Check that we shadow this member. | |
| 11 import "deferred_shadow_load_library_lib.dart" deferred as lib; | |
| 9 | 12 |
| 10 @lazy import 'deferred_class_library2.dart' as lib; | 13 void main() { |
| 11 | 14 var x = lib.loadLibrary(); |
| 12 const lazy = const DeferredLibrary('deferred_class_library2'); | 15 Expect.isTrue(x is Future); |
| 13 | |
| 14 main() { | |
| 15 asyncStart(); | 16 asyncStart(); |
| 16 lazy.load().then((bool didLoad) { | 17 x.then((_) { |
| 17 Expect.isTrue(didLoad); | 18 Expect.isTrue(lib.trueVar); |
|
floitsch
2014/03/19 21:04:51
check that loadLibrary is still shadowed once the
sigurdm
2014/03/20 12:26:33
Done.
| |
| 18 Expect.equals(499, lib.C1.value); | |
| 19 asyncEnd(); | 19 asyncEnd(); |
| 20 }); | 20 }); |
| 21 } | 21 } |
| OLD | NEW |