]> 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>
Wed, 25 Sep 2019 15:49:32 +0000 (17:49 +0200)
commit2f666c1daba43d26d77d9500db09d528bf66fac8
treec03612d12f7e81acbfbccd16884ac0b390219f7b
parent78ff24dd4b7c18d3c72cfbfe871a8cd3cbf3caee
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.

(cherry picked from 9df4f1de12728b44a4b0f91748f12421008d9079)

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