ECMAScript 2017中ES5的13.2节「创建函数对象」去向何方?
Great question! I totally get why you’d miss that section—it was super useful for understanding what’s happening under the hood when a function gets created. The short answer is: it wasn’t removed, it was refactored and split across multiple sections of the ES8 (ES2017) spec to accommodate the new function features introduced in ES6 and beyond.
Here’s how the content from ES5’s 13.2 ended up in ES8:
- Syntax definitions stayed in the obvious place: You already found ES8’s 14.1节「Function Definitions」, which maps to ES5’s broader 13 section. This covers the syntax for function declarations, expressions, arrow functions, and more—just like the top-level of ES5’s 13, but updated for new syntax.
- The core "function object creation" logic moved to internal object specs: The step-by-step process of creating a function object, including setting up its internal scope, formal parameters, and special internal methods, is now in 9.2节「Ordinary Function Objects」 and 9.3节「Built-in Function Objects」. These sections detail the internal slots (like
[[Environment]]and[[FormalParameters]]) that replace ES5’s internal properties, and walk through how a function object is initialized. - Execution behavior split into dedicated sections: The rules for how functions are called (
[[Call]]internal method) and constructed ([[Construct]]internal method) are now in 9.2.1 and 9.2.2 respectively. For specialized function types like arrow functions or async functions, their specific evaluation rules are in their own subsections (e.g., arrow functions in 14.2.16).
The reason for this split is that ES6 added a ton of new function variants (arrow functions, generators, async functions) that have different behaviors. The old ES5 structure was too monolithic to handle all these cases cleanly, so the spec authors reorganized the content to be more modular—grouping syntax, object structure, and execution logic separately.
If you’re looking to replicate the insight from ES5’s 13.2, head straight to ES8’s 9.2节「Ordinary Function Objects」. It has all the low-level details about how a function object is created, just with more precise terminology and support for modern function features.
内容的提问来源于stack exchange,提问作者Magnus

