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

Unified Diff: lib/core/future_impl.dart

Issue 11231043: Move FutureImpl and CompleterImpl from coreimpl to core, while also making them private. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months 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
« no previous file with comments | « lib/core/future.dart ('k') | lib/coreimpl/coreimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/core/future_impl.dart
diff --git a/lib/coreimpl/future_implementation.dart b/lib/core/future_impl.dart
similarity index 93%
rename from lib/coreimpl/future_implementation.dart
rename to lib/core/future_impl.dart
index 8e1efd0ed858fa56007148cb01b4de488fb8553b..bbae82d1667ffaff49b056c537143ee23b10d050 100644
--- a/lib/coreimpl/future_implementation.dart
+++ b/lib/core/future_impl.dart
@@ -1,7 +1,7 @@
// Copyright 2012 Google Inc. All Rights Reserved.
// Dart core library.
-class FutureImpl<T> implements Future<T> {
+class _FutureImpl<T> implements Future<T> {
bool _isComplete = false;
@@ -41,13 +41,13 @@ class FutureImpl<T> implements Future<T> {
*/
final List<Function> _completionListeners;
- FutureImpl()
+ _FutureImpl()
: _successListeners = [],
_exceptionHandlers = [],
_completionListeners = [];
- factory FutureImpl.immediate(T value) {
- final res = new FutureImpl();
+ factory _FutureImpl.immediate(T value) {
+ final res = new _FutureImpl();
res._setValue(value);
return res;
}
@@ -56,7 +56,7 @@ class FutureImpl<T> implements Future<T> {
if (!isComplete) {
throw new FutureNotCompleteException();
}
- if (_exception !== null) {
+ if (_exception != null) {
throw new FutureUnhandledException(_exception, stackTrace);
}
return _value;
@@ -81,7 +81,7 @@ class FutureImpl<T> implements Future<T> {
}
bool get hasValue {
- return isComplete && _exception === null;
+ return isComplete && _exception == null;
}
void then(void onSuccess(T value)) {
@@ -119,7 +119,7 @@ class FutureImpl<T> implements Future<T> {
_isComplete = true;
try {
- if (_exception !== null) {
+ if (_exception != null) {
for (Function handler in _exceptionHandlers) {
// Explicitly check for true here so that if the handler returns null,
// we don't get an exception in checked mode.
@@ -157,7 +157,7 @@ class FutureImpl<T> implements Future<T> {
}
void _setException(Object exception, Object stackTrace) {
- if (exception === null) {
+ if (exception == null) {
// null is not a legal value for the exception of a Future.
throw new ArgumentError(null);
}
@@ -250,11 +250,11 @@ class FutureImpl<T> implements Future<T> {
}
}
-class CompleterImpl<T> implements Completer<T> {
+class _CompleterImpl<T> implements Completer<T> {
- final FutureImpl<T> _futureImpl;
+ final _FutureImpl<T> _futureImpl;
- CompleterImpl() : _futureImpl = new FutureImpl() {}
+ _CompleterImpl() : _futureImpl = new _FutureImpl() {}
Future<T> get future {
return _futureImpl;
@@ -268,3 +268,4 @@ class CompleterImpl<T> implements Completer<T> {
_futureImpl._setException(exception, stackTrace);
}
}
+
« no previous file with comments | « lib/core/future.dart ('k') | lib/coreimpl/coreimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698