more utility
This commit is contained in:
parent
277f59e54a
commit
d8c18ccf17
@ -4,6 +4,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import me.topchetoeu.jscript.common.environment.Environment;
|
||||
import me.topchetoeu.jscript.runtime.values.Value;
|
||||
@ -72,6 +73,9 @@ public class ArrayValue extends ArrayLikeValue implements Iterable<Value> {
|
||||
copyTo(res, 0, 0, size);
|
||||
return res;
|
||||
}
|
||||
public Stream<Value> stream() {
|
||||
return Arrays.stream(toArray());
|
||||
}
|
||||
|
||||
public void copyTo(Value[] arr, int sourceStart, int destStart, int count) {
|
||||
var nullFill = Math.max(0, arr.length - size - destStart);
|
||||
|
Loading…
Reference in New Issue
Block a user