mirror of
https://github.com/esiur/esiur-js.git
synced 2025-05-06 04:22:58 +00:00
Bad Spread operator
This commit is contained in:
parent
2c057bc352
commit
735a19cda3
@ -73,9 +73,16 @@ export default class BinaryList
|
||||
}
|
||||
|
||||
addDC(value) {
|
||||
this.list.push(...value);
|
||||
// this is bad, will cause Maximum stack execution exception for large arrays
|
||||
// this.list.push(...value);
|
||||
// Fixed
|
||||
this.list = this.list.concat(Array.from(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
insertDC(position, value){
|
||||
this.list = this.list.slice(0, position).concat(value).concat(this.list.slice(position));
|
||||
}
|
||||
|
||||
insertUint8Array(position, value) {
|
||||
this.insertDC(position, value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user