ecma262
ecma262 copied to clipboard
Should AggregateError#errors be listed as an instance property?
Currently, https://tc39.es/ecma262/#sec-properties-of-aggregate-error-instances does not list any property other than internal slots. However, errors is unconditionally added as a property by the constructor, so it probably should be mentioned as a property? I understand that Error#cause and Error#message are probably absent because they're not always present. Other always-present properties like Function#length and RegExp#lastIndex are already listed.
Discussed this on the editor call. We're in favor of listing the instance properties with the following provisos:
- Instance properties are installed by algorithmic steps in the constructor. Unlike prototype properties, which all have default property descriptor attributes, the constructor's algorithmic steps should remain the source of truth for readers and implementations. As such, there should be some prose explicitly referring back to the constructor algorithm steps in this new section.
- Instance properties that are conditionally installed (like
.cause) should be listed but explicitly called out as conditionally present.
To be clear, these rules should apply to the existing sections such as Function#length and RegExp#lastIndex as well.
Instance properties that are conditionally installed (like
.cause) should be listed but explicitly called out as conditionally present.
Great, even better! For context, I'm parsing the spec and scraping data about each API to check MDN content accuracy/exhaustiveness. Adding cause would help a lot with that.