mirror of
https://github.com/esiur/esiur-js.git
synced 2025-05-06 12:32:58 +00:00
Bad Spread operator
This commit is contained in:
parent
2c057bc352
commit
735a19cda3
@ -73,10 +73,17 @@ export default class BinaryList
|
|||||||
}
|
}
|
||||||
|
|
||||||
addDC(value) {
|
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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insertDC(position, value){
|
||||||
|
this.list = this.list.slice(0, position).concat(value).concat(this.list.slice(position));
|
||||||
|
}
|
||||||
|
|
||||||
insertUint8Array(position, value) {
|
insertUint8Array(position, value) {
|
||||||
this.insertDC(position, value);
|
this.insertDC(position, value);
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user