Bug 232075 - [JSC] Implement Date.prototype.toTemporalInstant()
Summary: [JSC] Implement Date.prototype.toTemporalInstant()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 229826
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-21 04:58 PDT by Aditi Singh
Modified: 2022-09-01 03:09 PDT (History)
11 users (show)

See Also:


Attachments
Patch (8.77 KB, patch)
2021-11-23 00:56 PST, Aditi Singh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aditi Singh 2021-10-21 04:58:31 PDT
Method to map a legacy ECMAScript Date instance into a Temporal.Instant instance corresponding to the same instant in exact time.
Comment 1 Radar WebKit Bug Importer 2021-10-28 04:59:19 PDT
<rdar://problem/84752707>
Comment 2 Aditi Singh 2021-11-23 00:56:23 PST
Created attachment 445015 [details]
Patch
Comment 3 Yusuke Suzuki 2021-11-24 07:15:42 PST
Comment on attachment 445015 [details]
Patch

r=me
Comment 4 EWS 2021-11-24 07:45:47 PST
Committed r286149 (244533@main): <https://commits.webkit.org/244533@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445015 [details].
Comment 5 Mikhail R. Gadelha 2022-08-31 09:50:06 PDT
Hey Aditi, clang is warning about an off-by-one error here:

DatePrototype.cpp:934:93: warning: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-const-int-float-conversion]
    ASSERT(epochMilliseconds >= std::numeric_limits<int64_t>::min() && epochMilliseconds <= std::numeric_limits<int64_t>::max());
                                                                                         ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mgadelha/tools/WebKit/WebKitBuild/Debug/WTF/Headers/wtf/Assertions.h:363:11: note: expanded from macro 'ASSERT'
    if (!(assertion)) { \
          ^~~~~~~~~
1 warning generated.
Comment 6 Aditi Singh 2022-09-01 03:09:03 PDT
(In reply to Mikhail R. Gadelha from comment #5)
> Hey Aditi, clang is warning about an off-by-one error here:
> 
> DatePrototype.cpp:934:93: warning: implicit conversion from 'long' to
> 'double' changes value from 9223372036854775807 to 9223372036854775808
> [-Wimplicit-const-int-float-conversion]
>     ASSERT(epochMilliseconds >= std::numeric_limits<int64_t>::min() &&
> epochMilliseconds <= std::numeric_limits<int64_t>::max());
>                                                                             
> ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/mgadelha/tools/WebKit/WebKitBuild/Debug/WTF/Headers/wtf/Assertions.h:
> 363:11: note: expanded from macro 'ASSERT'
>     if (!(assertion)) { \
>           ^~~~~~~~~
> 1 warning generated.

Um, I'll look into this.