Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Unified Diff: pkg/compiler/lib/src/universe/world_builder.dart

Issue 2580353002: Make ClosedWorld a `forTesting` property of ResolutionWorldBuilder. (Closed)
Patch Set: Small fix. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/universe/world_builder.dart
diff --git a/pkg/compiler/lib/src/universe/world_builder.dart b/pkg/compiler/lib/src/universe/world_builder.dart
index 130b7eb4e9b7e138a185f8a53110431deb82d53d..cd676bdc659516be8858ced85e430770d49e5009 100644
--- a/pkg/compiler/lib/src/universe/world_builder.dart
+++ b/pkg/compiler/lib/src/universe/world_builder.dart
@@ -172,6 +172,11 @@ abstract class ResolutionWorldBuilder implements WorldBuilder {
/// The [OpenWorld] being created by this world builder.
// TODO(johnniwinther): Merge this with [ResolutionWorldBuilder].
OpenWorld get openWorld;
+
+ /// The closed world computed by this world builder.
+ ///
+ /// This is only available after the world builder has been closed.
+ ClosedWorld get closedWorldForTesting;
}
/// The type and kind of an instantiation registered through
@@ -425,7 +430,7 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
/// and classes.
bool useInstantiationMap = false;
- OpenWorld _openWorld;
+ WorldImpl _openWorld;
final Backend _backend;
final Resolution _resolution;
@@ -443,6 +448,14 @@ class ResolutionWorldBuilderImpl implements ResolutionWorldBuilder {
OpenWorld get openWorld => _openWorld;
+ ClosedWorld get closedWorldForTesting {
+ if (!_openWorld.isClosed) {
+ throw new SpannableAssertionFailure(
+ NO_LOCATION_SPANNABLE, "The world builder has not yet been closed.");
+ }
+ return _openWorld;
+ }
+
/// All directly instantiated classes, that is, classes with a generative
/// constructor that has been called directly and not only through a
/// super-call.
« no previous file with comments | « pkg/compiler/lib/src/js_backend/enqueuer.dart ('k') | tests/compiler/dart2js/assert_message_throw_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698