mirror of
				https://github.com/esiur/esiur-js.git
				synced 2025-10-27 16:40:28 +00:00 
			
		
		
		
	Bad Spread operator
This commit is contained in:
		| @@ -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; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user