dart-sdk/tests/language/regress_22443_test.dart
hausner@google.com dc602ae96d Mark code when it instantiates an unloaded deferred type
The VM registers code objects that depend on deferred library prefixes,
e.g. when calling a function in the deferred library. We didn’t do this
when instantiating a type from the deferred library.

This is a fix for issue 22443.

R=regis@google.com

Review URL: https://codereview.chromium.org//1037343002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44757 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 19:39:31 +00:00

24 lines
565 B
Dart

// Copyright (c) 2015, 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.
import 'regress_22443_lib.dart' deferred as D;
import 'package:expect/expect.dart';
int fooCount = 0;
foo() {
fooCount++;
return new D.LazyClass();
}
main() {
var caughtIt = false;
try { foo(); } catch (e) { caughtIt = true; };
D.loadLibrary().then((_) {
foo();
Expect.isTrue(caughtIt);
Expect.equals(2, fooCount);
});
}