Skip to content

Commit 2ede0ed

Browse files
author
John Messerly
committed
Merge pull request #388 from jonaskello/babel-workarounds
Babel workarounds
2 parents d0cec4a + 958b569 commit 2ede0ed

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

pkg/dev_compiler/lib/runtime/dart/async.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -663,20 +663,20 @@ dart_library.library('dart/async', null, /* Imports */[
663663
let subscription = null;
664664
let timer = null;
665665
let zone = null;
666-
let timeout = null;
666+
let timeout2 = null;
667667
function onData(event) {
668668
dart.as(event, T);
669669
timer.cancel();
670670
controller.add(event);
671-
timer = zone.createTimer(timeLimit, dart.as(timeout, __CastType17));
671+
timer = zone.createTimer(timeLimit, dart.as(timeout2, __CastType17));
672672
}
673673
dart.fn(onData, dart.void, [T]);
674674
function onError(error, stackTrace) {
675675
timer.cancel();
676676
dart.assert(dart.is(controller, _StreamController) || dart.is(controller, _BroadcastStreamController));
677677
let eventSink = dart.as(controller, _EventSink$(T));
678678
eventSink[_addError](error, stackTrace);
679-
timer = zone.createTimer(timeLimit, dart.as(timeout, dart.functionType(dart.void, [])));
679+
timer = zone.createTimer(timeLimit, dart.as(timeout2, dart.functionType(dart.void, [])));
680680
}
681681
dart.fn(onError, dart.void, [dart.dynamic, core.StackTrace]);
682682
function onDone() {
@@ -687,20 +687,20 @@ dart_library.library('dart/async', null, /* Imports */[
687687
let onListen = (function() {
688688
zone = Zone.current;
689689
if (onTimeout == null) {
690-
timeout = dart.fn(() => {
690+
timeout2 = dart.fn(() => {
691691
controller.addError(new TimeoutException("No stream event", timeLimit), null);
692692
});
693693
} else {
694694
onTimeout = dart.as(zone.registerUnaryCallback(onTimeout), __CastType18);
695695
let wrapper = new _ControllerEventSinkWrapper(null);
696-
timeout = dart.fn(() => {
696+
timeout2 = dart.fn(() => {
697697
wrapper[_sink] = controller;
698698
zone.runUnaryGuarded(onTimeout, wrapper);
699699
wrapper[_sink] = null;
700700
});
701701
}
702702
subscription = this.listen(onData, {onError: onError, onDone: onDone});
703-
timer = zone.createTimer(timeLimit, dart.as(timeout, dart.functionType(dart.void, [])));
703+
timer = zone.createTimer(timeLimit, dart.as(timeout2, dart.functionType(dart.void, [])));
704704
}).bind(this);
705705
dart.fn(onListen, dart.void, []);
706706
function onCancel() {
@@ -715,7 +715,7 @@ dart_library.library('dart/async', null, /* Imports */[
715715
subscription.pause();
716716
}), dart.fn(() => {
717717
subscription.resume();
718-
timer = zone.createTimer(timeLimit, dart.as(timeout, dart.functionType(dart.void, [])));
718+
timer = zone.createTimer(timeLimit, dart.as(timeout2, dart.functionType(dart.void, [])));
719719
}), onCancel);
720720
return controller.stream;
721721
}
@@ -1889,10 +1889,10 @@ dart_library.library('dart/async', null, /* Imports */[
18891889
remaining = dart.notNull(remaining) - 1;
18901890
if (values != null) {
18911891
if (cleanUp != null) {
1892-
for (let value of values) {
1893-
if (value != null) {
1892+
for (let value2 of values) {
1893+
if (value2 != null) {
18941894
Future$().sync(dart.fn(() => {
1895-
dart.dcall(cleanUp, value);
1895+
dart.dcall(cleanUp, value2);
18961896
}));
18971897
}
18981898
}
@@ -3450,12 +3450,12 @@ dart_library.library('dart/async', null, /* Imports */[
34503450
this.addSubscription.resume();
34513451
}
34523452
cancel() {
3453-
let cancel = this.addSubscription.cancel();
3454-
if (cancel == null) {
3453+
let cancel2 = this.addSubscription.cancel();
3454+
if (cancel2 == null) {
34553455
this.addStreamFuture[_asyncComplete](null);
34563456
return null;
34573457
}
3458-
return cancel.whenComplete(dart.fn((() => {
3458+
return cancel2.whenComplete(dart.fn((() => {
34593459
this.addStreamFuture[_asyncComplete](null);
34603460
}).bind(this)));
34613461
}

pkg/dev_compiler/tool/input_sdk/lib/async/future.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ abstract class Future<T> {
268268
remaining--;
269269
if (values != null) {
270270
if (cleanUp != null) {
271-
for (var value in values) {
272-
if (value != null) {
271+
for (var value2 in values) {
272+
if (value2 != null) {
273273
// Ensure errors from cleanUp are uncaught.
274-
new Future.sync(() { cleanUp(value); });
274+
new Future.sync(() { cleanUp(value2); });
275275
}
276276
}
277277
}

pkg/dev_compiler/tool/input_sdk/lib/async/stream.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,20 +1212,20 @@ abstract class Stream<T> {
12121212
StreamSubscription<T> subscription;
12131213
Timer timer;
12141214
Zone zone;
1215-
Function timeout;
1215+
Function timeout2;
12161216

12171217
void onData(T event) {
12181218
timer.cancel();
12191219
controller.add(event);
1220-
timer = zone.createTimer(timeLimit, timeout);
1220+
timer = zone.createTimer(timeLimit, timeout2);
12211221
}
12221222
void onError(error, StackTrace stackTrace) {
12231223
timer.cancel();
12241224
assert(controller is _StreamController ||
12251225
controller is _BroadcastStreamController);
12261226
var eventSink = controller as _EventSink<T>;
12271227
eventSink._addError(error, stackTrace); // Avoid Zone error replacement.
1228-
timer = zone.createTimer(timeLimit, timeout);
1228+
timer = zone.createTimer(timeLimit, timeout2);
12291229
}
12301230
void onDone() {
12311231
timer.cancel();
@@ -1238,23 +1238,23 @@ abstract class Stream<T> {
12381238
// callback.
12391239
zone = Zone.current;
12401240
if (onTimeout == null) {
1241-
timeout = () {
1241+
timeout2 = () {
12421242
controller.addError(new TimeoutException("No stream event",
12431243
timeLimit), null);
12441244
};
12451245
} else {
12461246
onTimeout = zone.registerUnaryCallback(onTimeout);
12471247
_ControllerEventSinkWrapper wrapper =
12481248
new _ControllerEventSinkWrapper(null);
1249-
timeout = () {
1249+
timeout2 = () {
12501250
wrapper._sink = controller; // Only valid during call.
12511251
zone.runUnaryGuarded(onTimeout, wrapper);
12521252
wrapper._sink = null;
12531253
};
12541254
}
12551255

12561256
subscription = this.listen(onData, onError: onError, onDone: onDone);
1257-
timer = zone.createTimer(timeLimit, timeout);
1257+
timer = zone.createTimer(timeLimit, timeout2);
12581258
}
12591259
Future onCancel() {
12601260
timer.cancel();
@@ -1273,7 +1273,7 @@ abstract class Stream<T> {
12731273
},
12741274
() {
12751275
subscription.resume();
1276-
timer = zone.createTimer(timeLimit, timeout);
1276+
timer = zone.createTimer(timeLimit, timeout2);
12771277
},
12781278
onCancel);
12791279
return controller.stream;

pkg/dev_compiler/tool/input_sdk/lib/async/stream_controller.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,12 +772,12 @@ class _AddStreamState<T> {
772772
* Return a future if the cancel takes time, otherwise return `null`.
773773
*/
774774
Future cancel() {
775-
var cancel = addSubscription.cancel();
776-
if (cancel == null) {
775+
var cancel2 = addSubscription.cancel();
776+
if (cancel2 == null) {
777777
addStreamFuture._asyncComplete(null);
778778
return null;
779779
}
780-
return cancel.whenComplete(() { addStreamFuture._asyncComplete(null); });
780+
return cancel2.whenComplete(() { addStreamFuture._asyncComplete(null); });
781781
}
782782

783783
void complete() {

pkg/dev_compiler/tool/sdk_expected_errors.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ warning: [DownCastComposite] _cancelAndErrorClosure(subscription, future) (dynam
6060
warning: [DownCastComposite] _cancelAndErrorClosure(subscription, future) (dynamic) will need runtime check to cast to type (dynamic, StackTrace) → dynamic (dart:async/stream.dart, line 1037, col 11)
6161
warning: [DownCastComposite] _cancelAndErrorClosure(subscription, future) (dynamic) will need runtime check to cast to type (dynamic, StackTrace) → dynamic (dart:async/stream.dart, line 1078, col 11)
6262
warning: [DownCastComposite] _cancelAndErrorClosure(subscription, future) (dynamic) will need runtime check to cast to type (dynamic, StackTrace) → dynamic (dart:async/stream.dart, line 1130, col 11)
63-
warning: [DownCastComposite] timeout (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1220, col 43)
64-
warning: [DownCastComposite] timeout (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1228, col 43)
63+
warning: [DownCastComposite] timeout2 (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1220, col 43)
64+
warning: [DownCastComposite] timeout2 (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1228, col 43)
6565
warning: [DownCastComposite] zone.registerUnaryCallback(onTimeout) ((dynamic) → dynamic) will need runtime check to cast to type (EventSink<dynamic>) → void (dart:async/stream.dart, line 1246, col 21)
66-
warning: [DownCastComposite] timeout (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1257, col 43)
67-
warning: [DownCastComposite] timeout (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1276, col 53)
66+
warning: [DownCastComposite] timeout2 (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1257, col 43)
67+
warning: [DownCastComposite] timeout2 (Function) will need runtime check to cast to type () → void (dart:async/stream.dart, line 1276, col 53)
6868
warning: [DownCastComposite] sync ? new _NoCallbackSyncStreamController() : new _NoCallbackAsyncStreamController() (_StreamController<dynamic>) will need runtime check to cast to type StreamController<T> (dart:async/stream_controller.dart, line 83, col 14)
6969
warning: [DownCastComposite] subscription (_ControllerSubscription<dynamic>) will need runtime check to cast to type StreamSubscription<T> (dart:async/stream_controller.dart, line 516, col 12)
7070
warning: [DownCastComposite] controller (_StreamController<dynamic>) will need runtime check to cast to type _EventSink<T> (dart:async/stream_controller.dart, line 798, col 15)

0 commit comments

Comments
 (0)