File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ if (module.parent && module.parent.id === 'internal/preload') {
66import ( './index.mjs' )
77 . then ( ( { Temporal, Intl, toTemporalInstant } ) => {
88 globalThis . Temporal = { ...Temporal } ;
9+ Object . defineProperty ( globalThis . Temporal , Symbol . toStringTag , {
10+ value : 'Temporal' ,
11+ writable : false ,
12+ enumerable : false ,
13+ configurable : true
14+ } ) ;
915 Object . assign ( globalThis . Intl , Intl ) ;
1016 Object . defineProperty ( Date . prototype , 'toTemporalInstant' , {
1117 value : toTemporalInstant ,
Original file line number Diff line number Diff line change @@ -49,3 +49,9 @@ export const Now = {
4949 zonedDateTime,
5050 zonedDateTimeISO
5151} ;
52+ Object . defineProperty ( Now , Symbol . toStringTag , {
53+ value : 'Temporal.Now' ,
54+ writable : false ,
55+ enumerable : false ,
56+ configurable : true
57+ } ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ describe('Temporal.Now', () => {
2929 it ( 'Temporal.Now.timeZone is a function' , ( ) => equal ( typeof Temporal . Now . timeZone , 'function' ) ) ;
3030 it ( 'Temporal.Now.zonedDateTimeISO is a function' , ( ) => equal ( typeof Temporal . Now . zonedDateTimeISO , 'function' ) ) ;
3131 it ( 'Temporal.Now.zonedDateTime is a function' , ( ) => equal ( typeof Temporal . Now . zonedDateTime , 'function' ) ) ;
32+ it ( 'Temporal.Now has a toStringTag' , ( ) => equal ( Temporal . Now . toString ( ) , '[object Temporal.Now]' ) ) ;
3233 } ) ;
3334 describe ( 'Temporal.Now.instant()' , ( ) => {
3435 it ( 'Temporal.Now.instant() returns an Instant' , ( ) => assert ( Temporal . Now . instant ( ) instanceof Temporal . Instant ) ) ;
You can’t perform that action at this time.
0 commit comments