Bug 229651

Summary: [JSC] Implement Temporal.Calendar
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, cdumez, cmarcelo, ews-watchlist, gyuyoung.kim, keith_miller, mark.lam, msaboff, philip.chimento, ross.kirsling, ryuan.choi, saam, sergio, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 223166    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch ross.kirsling: review+

Yusuke Suzuki
Reported 2021-08-28 16:13:08 PDT
...
Attachments
Patch (56.80 KB, patch)
2021-08-28 23:21 PDT, Yusuke Suzuki
no flags
Patch (70.41 KB, patch)
2021-08-29 03:41 PDT, Yusuke Suzuki
no flags
Patch (71.79 KB, patch)
2021-08-29 22:42 PDT, Yusuke Suzuki
no flags
Patch (71.83 KB, patch)
2021-08-30 03:00 PDT, Yusuke Suzuki
no flags
Patch (71.83 KB, patch)
2021-08-30 11:56 PDT, Yusuke Suzuki
ross.kirsling: review+
Yusuke Suzuki
Comment 1 2021-08-28 23:21:48 PDT
Yusuke Suzuki
Comment 2 2021-08-29 03:41:15 PDT
Yusuke Suzuki
Comment 3 2021-08-29 22:42:43 PDT
Yusuke Suzuki
Comment 4 2021-08-30 03:00:33 PDT
Yusuke Suzuki
Comment 5 2021-08-30 11:56:14 PDT
Philip Chimento
Comment 6 2021-08-30 12:24:00 PDT
Comment on attachment 436799 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436799&action=review > Source/JavaScriptCore/runtime/IntlObject.cpp:1594 > + if (string.is8Bit()) I believe all the BCP47 identifiers are ASCII-only, by definition? > Source/JavaScriptCore/runtime/TemporalCalendarPrototype.cpp:98 > + return throwVMTypeError(globalObject, scope, "Temporal.Calendar.prototype.fields called on value that's not an object initialized as a Calendar"_s); As in the Duration patch I think the brand check exception message would be clearer to developers without "an object initialized as"
Yusuke Suzuki
Comment 7 2021-08-30 12:45:00 PDT
Comment on attachment 436799 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436799&action=review >> Source/JavaScriptCore/runtime/IntlObject.cpp:1594 >> + if (string.is8Bit()) > > I believe all the BCP47 identifiers are ASCII-only, by definition? This is8Bit is WTF::String implementation detail, and it is possible that ASCII-only string can get 16bit strings. And it would be possible to make String 16bit internally in some cases (e.g. string is determined to be shared with the existing 16bit string). So putting both cases is better for safety and correctness :)
Ross Kirsling
Comment 8 2021-08-30 18:04:05 PDT
Comment on attachment 436799 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436799&action=review Looks good, given Philip's comments and the resolution of the Slack thread about implementation-definedness. > Source/WTF/ChangeLog:11 > + * wtf/text/StringImpl.cpp: > + (WTF::StringImpl::createStaticStringImpl): > + * wtf/text/StringImpl.h: > + (WTF::StringImpl::createStaticStringImpl): I think this deserves a brief explanation. :) > JSTests/stress/temporal-calendar.js:80 > + password: 'hunter2', // Note: Don't really store passwords like that 🤣
Yusuke Suzuki
Comment 9 2021-08-30 18:23:50 PDT
Comment on attachment 436799 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=436799&action=review >> Source/WTF/ChangeLog:11 >> + (WTF::StringImpl::createStaticStringImpl): > > I think this deserves a brief explanation. :) Added :) >> Source/JavaScriptCore/runtime/TemporalCalendarPrototype.cpp:98 >> + return throwVMTypeError(globalObject, scope, "Temporal.Calendar.prototype.fields called on value that's not an object initialized as a Calendar"_s); > > As in the Duration patch I think the brand check exception message would be clearer to developers without "an object initialized as" Changed to drop `an object initialized as...` part :)
Yusuke Suzuki
Comment 10 2021-08-30 18:56:41 PDT
Radar WebKit Bug Importer
Comment 11 2021-08-30 18:57:25 PDT
Note You need to log in before you can comment on or make changes to this bug.