Files
sdk/tests/compiler/dart2js/deferred_loading/data/deferred_function.dart
T
Johnni Winther ada23cde0b Add deferred test for local functions
Change-Id: I9f4b67de9435e74378af72d2a0c0fc711c0b0252
Reviewed-on: https://dart-review.googlesource.com/55891
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-18 19:33:48 +00:00

22 lines
586 B
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Test that loading of a library (with top-level functions only) can
// be deferred.
import '../libs/deferred_function_lib.dart' deferred as lib;
/*element: readFoo:OutputUnit(main, {})*/
readFoo() {
return lib.foo;
}
/*element: main:OutputUnit(main, {})*/
main() {
lib.loadLibrary().then(/*OutputUnit(main, {})*/ (_) {
lib.foo('b');
readFoo();
});
}