Skip to content

Commit 7db49e6

Browse files
committed
Fixed 3 final missing casts in dart:js
BUG= [email protected] Review URL: https://codereview.chromium.org/1931373002 .
1 parent d109467 commit 7db49e6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

pkg/dev_compiler/tool/input_sdk/lib/js/dart2js/js_dart2js.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class JsArray<E> extends JsObject with ListMixin<E> {
357357
if (index is num && index == index.toInt()) {
358358
_checkIndex(index);
359359
}
360-
return super[index];
360+
return super[index] as E;
361361
}
362362

363363
void operator []=(Object index, E value) {
@@ -403,12 +403,12 @@ class JsArray<E> extends JsObject with ListMixin<E> {
403403

404404
E removeAt(int index) {
405405
_checkIndex(index);
406-
return callMethod('splice', [index, 1])[0];
406+
return callMethod('splice', [index, 1])[0] as E;
407407
}
408408

409409
E removeLast() {
410410
if (length == 0) throw new RangeError(-1);
411-
return callMethod('pop');
411+
return callMethod('pop') as E;
412412
}
413413

414414
void removeRange(int start, int end) {

pkg/dev_compiler/tool/sdk_expected_errors.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,6 @@
255255
[warning] Unsound implicit cast from List<dynamic> to Iterable<T> (dart:_internal/iterable.dart, line 1011, col 40)
256256
[warning] Unsound implicit cast from List<dynamic> to Iterable<T> (dart:_internal/iterable.dart, line 1047, col 35)
257257
[warning] Unsound implicit cast from List<dynamic> to List<T> (dart:_internal/iterable.dart, line 1129, col 31)
258-
[warning] Unsound implicit cast from dynamic to E (dart:js, line 360, col 12)
259-
[warning] Unsound implicit cast from dynamic to E (dart:js, line 406, col 12)
260-
[warning] Unsound implicit cast from dynamic to E (dart:js, line 411, col 12)
261258
[warning] Unsound implicit cast from num to T (dart:math, line 85, col 16)
262259
[warning] Unsound implicit cast from num to T (dart:math, line 120, col 16)
263260
[warning] Unsound implicit cast from num to T (dart:math/point.dart, line 37, col 25)

0 commit comments

Comments
 (0)