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

Unified Diff: lib/runtime/dart/async.js

Issue 1643523008: fix #43, remove => workaround (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 11 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/runtime/dart/_runtime.js ('k') | lib/runtime/dart/collection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/async.js
diff --git a/lib/runtime/dart/async.js b/lib/runtime/dart/async.js
index 20a147aaf772cccfe0ed008125fa916a615809cd..88298c6abcfa62b9c12f340092801e93f5ba50e3 100644
--- a/lib/runtime/dart/async.js
+++ b/lib/runtime/dart/async.js
@@ -642,9 +642,9 @@ dart_library.library('dart/async', null, /* Imports */[
return;
}
elementIndex = elementIndex + 1;
- }, dart.void, [T]), {onError: dart.bind(future, _completeError), onDone: dart.fn((() => {
+ }, dart.void, [T]), {onError: dart.bind(future, _completeError), onDone: dart.fn(() => {
future[_completeError](core.RangeError.index(index, this, "index", null, elementIndex));
- }).bind(this), dart.void, []), cancelOnError: true});
+ }, dart.void, []), cancelOnError: true});
return future;
}
timeout(timeLimit, opts) {
@@ -956,10 +956,10 @@ dart_library.library('dart/async', null, /* Imports */[
this[_onDone] = dart.fn(() => {
result[_complete](futureValue);
}, dart.void, []);
- this[_onError] = dart.fn(((error, stackTrace) => {
+ this[_onError] = dart.fn((error, stackTrace) => {
this.cancel();
result[_completeError](error, dart.as(stackTrace, core.StackTrace));
- }).bind(this));
+ });
return result;
}
get [_isInputPaused]() {
@@ -2285,9 +2285,9 @@ dart_library.library('dart/async', null, /* Imports */[
[_addListener](listener) {
dart.assert(listener[_nextListener] == null);
if (dart.notNull(this[_isComplete])) {
- this[_zone].scheduleMicrotask(dart.fn((() => {
+ this[_zone].scheduleMicrotask(dart.fn(() => {
_Future$()._propagateToListeners(this, listener);
- }).bind(this), dart.void, []));
+ }, dart.void, []));
} else {
listener[_nextListener] = dart.as(this[_resultOrListeners], _FutureListener);
this[_resultOrListeners] = listener;
@@ -2367,9 +2367,9 @@ dart_library.library('dart/async', null, /* Imports */[
let coreFuture = dart.as(typedFuture, _Future$(T));
if (dart.notNull(coreFuture[_isComplete]) && dart.notNull(coreFuture[_hasError])) {
this[_markPendingCompletion]();
- this[_zone].scheduleMicrotask(dart.fn((() => {
+ this[_zone].scheduleMicrotask(dart.fn(() => {
_Future$()._chainCoreFuture(coreFuture, this);
- }).bind(this), dart.void, []));
+ }, dart.void, []));
} else {
_Future$()._chainCoreFuture(coreFuture, this);
}
@@ -2381,16 +2381,16 @@ dart_library.library('dart/async', null, /* Imports */[
let typedValue = dart.as(value, T);
}
this[_markPendingCompletion]();
- this[_zone].scheduleMicrotask(dart.fn((() => {
+ this[_zone].scheduleMicrotask(dart.fn(() => {
this[_completeWithValue](value);
- }).bind(this), dart.void, []));
+ }, dart.void, []));
}
[_asyncCompleteError](error, stackTrace) {
dart.assert(!dart.notNull(this[_isComplete]));
this[_markPendingCompletion]();
- this[_zone].scheduleMicrotask(dart.fn((() => {
+ this[_zone].scheduleMicrotask(dart.fn(() => {
this[_completeError](error, stackTrace);
- }).bind(this), dart.void, []));
+ }, dart.void, []));
}
static _propagateToListeners(source, listeners) {
while (true) {
@@ -3117,9 +3117,9 @@ dart_library.library('dart/async', null, /* Imports */[
this[_varData] = subscription;
}
subscription[_setPendingEvents](pendingEvents);
- subscription[_guardCallback](dart.fn((() => {
+ subscription[_guardCallback](dart.fn(() => {
_runGuarded(this[_onListen]);
- }).bind(this)));
+ }));
return dart.as(subscription, StreamSubscription$(T));
}
[_recordCancel](subscription) {
@@ -3394,9 +3394,9 @@ dart_library.library('dart/async', null, /* Imports */[
this.addStreamFuture[_asyncComplete](null);
return null;
}
- return cancel2.whenComplete(dart.fn((() => {
+ return cancel2.whenComplete(dart.fn(() => {
this.addStreamFuture[_asyncComplete](null);
- }).bind(this)));
+ }));
}
complete() {
this.addStreamFuture[_asyncComplete](null);
@@ -3486,12 +3486,12 @@ dart_library.library('dart/async', null, /* Imports */[
this[_state] = _PendingEvents._STATE_SCHEDULED;
return;
}
- scheduleMicrotask(dart.fn((() => {
+ scheduleMicrotask(dart.fn(() => {
let oldState = this[_state];
this[_state] = _PendingEvents._STATE_UNSCHEDULED;
if (oldState == _PendingEvents._STATE_CANCELED) return;
this.handleNext(dispatch);
- }).bind(this), dart.void, []));
+ }, dart.void, []));
this[_state] = _PendingEvents._STATE_SCHEDULED;
}
cancelSchedule() {
@@ -5226,27 +5226,27 @@ dart_library.library('dart/async', null, /* Imports */[
let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true;
let registered = this.registerCallback(f);
if (dart.notNull(runGuarded)) {
- return dart.fn((() => this.runGuarded(registered)).bind(this));
+ return dart.fn(() => this.runGuarded(registered));
} else {
- return dart.fn((() => this.run(registered)).bind(this));
+ return dart.fn(() => this.run(registered));
}
}
bindUnaryCallback(f, opts) {
let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true;
let registered = this.registerUnaryCallback(f);
if (dart.notNull(runGuarded)) {
- return dart.fn((arg => this.runUnaryGuarded(registered, arg)).bind(this));
+ return dart.fn(arg => this.runUnaryGuarded(registered, arg));
} else {
- return dart.fn((arg => this.runUnary(registered, arg)).bind(this));
+ return dart.fn(arg => this.runUnary(registered, arg));
}
}
bindBinaryCallback(f, opts) {
let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true;
let registered = this.registerBinaryCallback(f);
if (dart.notNull(runGuarded)) {
- return dart.fn(((arg1, arg2) => this.runBinaryGuarded(registered, arg1, arg2)).bind(this));
+ return dart.fn((arg1, arg2) => this.runBinaryGuarded(registered, arg1, arg2));
} else {
- return dart.fn(((arg1, arg2) => this.runBinary(registered, arg1, arg2)).bind(this));
+ return dart.fn((arg1, arg2) => this.runBinary(registered, arg1, arg2));
}
}
get(key) {
@@ -5609,25 +5609,25 @@ dart_library.library('dart/async', null, /* Imports */[
bindCallback(f, opts) {
let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true;
if (dart.notNull(runGuarded)) {
- return dart.fn((() => this.runGuarded(f)).bind(this));
+ return dart.fn(() => this.runGuarded(f));
} else {
- return dart.fn((() => this.run(f)).bind(this));
+ return dart.fn(() => this.run(f));
}
}
bindUnaryCallback(f, opts) {
let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true;
if (dart.notNull(runGuarded)) {
- return dart.fn((arg => this.runUnaryGuarded(f, arg)).bind(this));
+ return dart.fn(arg => this.runUnaryGuarded(f, arg));
} else {
- return dart.fn((arg => this.runUnary(f, arg)).bind(this));
+ return dart.fn(arg => this.runUnary(f, arg));
}
}
bindBinaryCallback(f, opts) {
let runGuarded = opts && 'runGuarded' in opts ? opts.runGuarded : true;
if (dart.notNull(runGuarded)) {
- return dart.fn(((arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2)).bind(this));
+ return dart.fn((arg1, arg2) => this.runBinaryGuarded(f, arg1, arg2));
} else {
- return dart.fn(((arg1, arg2) => this.runBinary(f, arg1, arg2)).bind(this));
+ return dart.fn((arg1, arg2) => this.runBinary(f, arg1, arg2));
}
}
get(key) {
« no previous file with comments | « lib/runtime/dart/_runtime.js ('k') | lib/runtime/dart/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698