mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 15:17:07 +00:00
Implement List.empty() in the DDC patch file.
Change-Id: Ib588f52daebea9a51f3aeed858e418406d57a8bc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123960 Auto-Submit: Bob Nystrom <rnystrom@google.com> Reviewed-by: Leaf Petersen <leafp@google.com> Commit-Queue: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
parent
e83e66111d
commit
28cc459458
1 changed files with 7 additions and 0 deletions
|
@ -410,6 +410,13 @@ class List<E> {
|
|||
return JSArray<E>.of(list);
|
||||
}
|
||||
|
||||
@patch
|
||||
factory List.empty({bool growable = false}) {
|
||||
var list = JSArray<E>.of(JS('', 'new Array()'));
|
||||
if (!growable) JSArray.markFixedList(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@patch
|
||||
factory List.filled(@nullCheck int length, E fill, {bool growable = false}) {
|
||||
var list = JSArray<E>.of(JS('', 'new Array(#)', length));
|
||||
|
|
Loading…
Reference in a new issue