- From: ExE Boss <notifications@github.com>
- Date: Sun, 12 Jan 2020 13:50:05 -0800
- To: heycam/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <heycam/webidl/issues/831@github.com>
The `[[IsClassConstructor]]` internal slot is set to `true` for function objects created with the **ES6** `class` keyword. In interfaces without overriden constructor steps, step 1 ensures that this interface was declared with a `constructor` operation and step 2 ensures that `NewTarget` is not `undefined`. The `[[IsClassConstructor]]` Function internal slot takes care of step 2 by throwing a `TypeError` at the beginning of the `[[Call]]` internal operation, which is faster, as the `[[Call]]` algorithm only needs to check a boolean internal slot, instead of needing to prepare and push the constructor implementation to the execution context stack. --- This also means that **WebIDL2JS** isn’t quite spec compliant, as it has <code>[[IsClassConstructor]] === true</code>, whereas native implementations have it currently set to `false`. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/heycam/webidl/issues/831
Received on Sunday, 12 January 2020 21:50:08 UTC