]> source.dussan.org Git - jquery.git/commit
Core: Use Array.prototype.flat where supported
authorAhmed.S.ElAfifi <ahmed.s.elafifi@gmail.com>
Mon, 19 Aug 2019 08:04:01 +0000 (10:04 +0200)
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Tue, 24 Sep 2019 23:38:21 +0000 (01:38 +0200)
commit9df4f1de12728b44a4b0f91748f12421008d9079
treea8864c22790c5045db115c789af5dfecebeb6a02
parentaa6344baf87145ffc807a527d9c1fb03c96b1948
Core: Use Array.prototype.flat where supported

Calling `Array.prototype.concat.apply( [], inputArray )` to flatten `inputArray`
crashes for large arrays; using `Array.prototype.flat` avoids these issues in
browsers that support it. In case it's necessary to support these large arrays
even in older browsers, a polyfill for `Array.prototype.flat` can be loaded.
This is already being done by many applications.

Fixes gh-4320
Closes gh-4459
src/core.js
src/manipulation.js
src/var/concat.js [deleted file]
src/var/flat.js [new file with mode: 0644]
test/unit/core.js