Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

$.map() fails with large arrays in Сhrome #4320

Closed
@fantaclaus

Description

@fantaclaus

When a large array is passed as an argument to$.map() we get an error:

RangeError: Maximum call stack size exceeded

Tested on Chrome72 for Windows.
JQuery version:3.3.1

Sample code:

$.map(newArray(300000),i=>1)

Internally it calls toconcat.apply and crashes there.

As long as I understand,apply tries to push all elements of the array into the stack before invoking the functionconcat and fails on stack shortage.

I believe that any function being invoked thruapply with a large array as an argument will fail.

I've found about 14 usages ofapply in the code of jQuery. I would suggest you to check out all of these cases.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp