Hi Philip, On Thu, Jul 18, 2024 at 12:19 PM Philip Hofstetter <phofstet...@sensational.ch> wrote: > Super minor nitpick: You have updated the prototype, but not the explanation > text which still says: > >> When initialization is required, the $initializer is called with the object >> as first parameter. The initializer should initialize the object, and must >> return null (or void). See the “Initialization Sequence” section.
I've updated the text as suggested, as the Initialization Sequence section also specifies how the function should return. The Initialization Sequence section says approximately the same thing, however: "The initializer must return null or no value. If the initializer returns something other than null, a TypeError is thrown". The reason is that all function calls evaluate to a value, including when calling a void function, so void functions actually return null. Unfortunately we have no good way to enforce a void return, unless we check the declared return type of the function, but it would not work for all kinds of callables. Documenting the signature as returning void is fine, though. Note that the return value is not important currently: We just check that it's null so that we reserve the possibility to give the return value a meaning in the future. Best Regards, Arnaud