I tried to understand the semantics of Date() constructors with arguments, as defined in sections 22.214.171.124 and 126.96.36.199 of ECMA-262, 10th edition. The step 3 in both sections says:
- If NewTarget is undefined, then
a. Let now be the Number that is the time value (UTC) identifying the current time.
b. Return ToDateString(now).
If I understand correctly, "NewTarget is undefined" means that the constructor is being called as a function. This step seems to say that if Date() with argument(s) is called as a function, the argument(s) are ignored and current time is returned. Or, just maybe, it is an unedited copy-paste from the Date() with no arguments?
I am new to reading the ECMAScript specification, which is not particularly fool-friendly, so I thought I will ask a question before formally reporting an issue: What am I missing?