core icon indicating copy to clipboard operation
core copied to clipboard

fix(runtime-core): ensure functional component's context parameter is not null. (fix: #6580 )

Open yangjunjun opened this issue 2 years ago • 2 comments

When funtional component's props has default value, the length of this funtional componet will be 0, which will cause the second paramter to be null, as the issue show. so the solution is always keep the second paramters have value. the same as componet's setup option.

MDN docs of Function.length:

length is a property of a function object, and indicates how many arguments the function expects, i.e. the number of formal parameters. This number excludes the rest parameter and only includes parameters before the first one with a default value. By contrast, arguments.length is local to a function and provides the number of arguments actually passed to the function.

fix #6580

yangjunjun avatar Sep 02 '22 07:09 yangjunjun