In Java, the maximum size of a function is 65535 bytes.
Is there any specified limits in ECMAScript?
What about known limitations in browsers?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are no defined limits to the maximum size of a FunctionBody in the ECMAScript specification, nor are there any ― as far as I’m aware ― documented limitations on the maximum sizes of function declarations in browsers.
Many browsers do have size limits on string lengths, for instance 512MB in Chrome, so any function created with the
Functionconstructor could certainly not be larger than this limit, and it’s possible the same or a similar limit applies to functions in parsed code too.