[Webkit-unassigned] [Bug 105282] Date.prototype.toJSON does not execute steps 1-2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 13 17:26:16 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=105282

--- Comment #21 from Alexey Shvayka <shvaikalesh at gmail.com> ---
(In reply to Ross Kirsling from comment #13)
> 
> Yeah, that seems fine -- guess it's trying to avoid calling std::isfinite
> unnecessarily, but that should just amount to `return true` for integral
> types anyway.

Thanks, it didn't occur to me that std::isfinite might be slow.
I've benchmarked code path that is largely dependent on finiteness check performance with:

```
const date = new Date(NaN);
for (let i = 0; i < 1e6; ++i)
  date.toJSON();
```

Proposed tweak and trunk did perform equally (within 1%).

(In reply to Mark Lam from comment #15)
> 
> Secondly, in my personal experience, when I have to write a descriptive
> ChangeLog, it forces me to make sure that I really understand what I'm
> changing, and serves as a sanity check to prevent bugs from creeping in.

Thank you for detailed explanation. As outside contributor, I find ChangeLogs extremely useful as sources of motivation for some classes like JSCell or CustomGetterSetter. Also, descriptive ChangeLog for this patch in particular is highly important, because first comment and bug title are quite different from what the patch fixes.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190914/83ea6d6f/attachment.html>


More information about the webkit-unassigned mailing list