@@ -121,13 +121,19 @@ class JSArray<E> extends JavaScriptObject implements List<E>, JSIndexable<E> {
121121 @pragma ('dart2js:prefer-inline' )
122122 static List <T > markFixedList <T >(List <T > list) {
123123 return JS (
124- 'JSFixedArray' , '#' , HArrayFlagsSet (list, ArrayFlags .fixedLength));
124+ 'JSFixedArray' ,
125+ '#' ,
126+ HArrayFlagsSet (list, ArrayFlags .fixedLength),
127+ );
125128 }
126129
127130 @pragma ('dart2js:prefer-inline' )
128131 static List <T > markUnmodifiableList <T >(List list) {
129- return JS ('JSUnmodifiableArray' , '#' ,
130- HArrayFlagsSet (list, ArrayFlags .unmodifiable));
132+ return JS (
133+ 'JSUnmodifiableArray' ,
134+ '#' ,
135+ HArrayFlagsSet (list, ArrayFlags .unmodifiable),
136+ );
131137 }
132138
133139 static bool isFixedLength (JSArray a) {
@@ -149,7 +155,12 @@ class JSArray<E> extends JavaScriptObject implements List<E>, JSIndexable<E> {
149155 checkMutable (String operation, String verb) {
150156 final int flags = HArrayFlagsGet (this );
151157 HArrayFlagsCheck (
152- this , flags, ArrayFlags .unmodifiableCheck, operation, verb);
158+ this ,
159+ flags,
160+ ArrayFlags .unmodifiableCheck,
161+ operation,
162+ verb,
163+ );
153164 }
154165
155166 checkGrowable (String operation, String verb) {
@@ -623,9 +634,8 @@ class JSArray<E> extends JavaScriptObject implements List<E>, JSIndexable<E> {
623634 // with an assignment like `a[i] = a[j]`.
624635
625636 int undefineds = 0 ;
626- // The element type might exclude the possibility of there being `null`s,
627- // but only in sound null safety mode.
628- if (JS_GET_FLAG ('LEGACY' ) || null is E ) {
637+ // The element type might exclude the possibility of there being `null`s.
638+ if (null is E ) {
629639 for (int i = 0 ; i < length; i++ ) {
630640 final E element = JS ('' , '#[#]' , this , i);
631641 if (JS ('' , '# === void 0' , element)) {
@@ -726,9 +736,10 @@ class JSArray<E> extends JavaScriptObject implements List<E>, JSIndexable<E> {
726736 List <E > toList ({bool growable = true }) =>
727737 growable ? _toListGrowable () : _toListFixed ();
728738
729- List <E > _toListGrowable () =>
730- // slice(0) is slightly faster than slice()
731- JSArray <E >.markGrowable (JS ('' , '#.slice(0)' , this ));
739+ List <E > _toListGrowable () {
740+ // slice(0) is slightly faster than slice()
741+ return JSArray <E >.markGrowable (JS ('' , '#.slice(0)' , this ));
742+ }
732743
733744 List <E > _toListFixed () => JSArray <E >.markFixed (JS ('' , '#.slice(0)' , this ));
734745
@@ -768,8 +779,10 @@ class JSArray<E> extends JavaScriptObject implements List<E>, JSIndexable<E> {
768779 void _setLengthUnsafe (int newLength) {
769780 assert (newLength is int , throw ArgumentError .value (newLength, 'newLength' ));
770781
771- assert (newLength >= 0 ,
772- throw RangeError .range (newLength, 0 , null , 'newLength' ));
782+ assert (
783+ newLength >= 0 ,
784+ throw RangeError .range (newLength, 0 , null , 'newLength' ),
785+ );
773786
774787 // JavaScript with throw a RangeError for numbers that are too big. The
775788 // message does not contain the value.
@@ -785,8 +798,12 @@ class JSArray<E> extends JavaScriptObject implements List<E>, JSIndexable<E> {
785798
786799 void operator []= (int index, E value) {
787800 final int flags = HArrayFlagsGet (this );
788- final checked =
789- HArrayFlagsCheck (this , flags, ArrayFlags .unmodifiableCheck, '[]=' );
801+ final checked = HArrayFlagsCheck (
802+ this ,
803+ flags,
804+ ArrayFlags .unmodifiableCheck,
805+ '[]=' ,
806+ );
790807
791808 if (index is ! int ) throw diagnoseIndexError (this , index);
792809 // This form of the range test correctly rejects NaN.
@@ -864,9 +881,9 @@ class ArrayIterator<E> implements Iterator<E> {
864881 E ? _current;
865882
866883 ArrayIterator (JSArray <E > iterable)
867- : _iterable = iterable,
868- _length = iterable.length,
869- _index = 0 ;
884+ : _iterable = iterable,
885+ _length = iterable.length,
886+ _index = 0 ;
870887
871888 E get current => _current as E ;
872889
0 commit comments