Ghi chú phát hành được viết bằng tiếng Anh.
Bound functions build objects the way the standard describes
Bound functions, a core JavaScript building block, now behave the way the standard describes. When you lock in a function's context or some of its arguments ahead of time and then use the result with new to build an object, it now works, builds the object correctly, and the object recognizes what it was built from. This holds even when several of these are layered together, and when objects are built through the reflection tools. Locking arguments onto something that is not a function now reports a clear error instead of appearing to succeed. Code that was already correct is unchanged. The JavaScript language aspect moves 96 to 97; the overall platform score stays at 70.
Những gì đã thay đổi
3 thay đổi- Hiển thịBuilding objects from a bound function works. A function with its context or leading arguments locked in ahead of time can now be used with new to build an object, with the locked-in arguments applied first, so widely used patterns that pre-configure a constructor this way behave correctly.
- Hiển thịThe built object recognizes what it came from. An object built from a bound function now inherits from the original function and is recognized as an instance of it, so type checks and inherited methods work as expected.
- Hiển thịLayered binds and reflection agree, and misuse is caught. Layering several of these together, or building through the reflection tools, produces the same correct result, and locking arguments onto something that is not a function now reports a clear error instead of silently appearing to succeed.















