File tree Expand file tree Collapse file tree 4 files changed +7
-1
lines changed Expand file tree Collapse file tree 4 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ export class Calendar implements Temporal.Calendar {
141141    } 
142142  } 
143143  get  id ( ) : Return [ 'id' ]  { 
144+     if  ( ! ES . IsTemporalCalendar ( this ) )  throw  new  TypeError ( 'invalid receiver' ) ; 
144145    return  ES . ToString ( this ) ; 
145146  } 
146147  dateFromFields ( 
@@ -334,6 +335,7 @@ export class Calendar implements Temporal.Calendar {
334335    return  GetSlot ( this ,  CALENDAR_ID ) ; 
335336  } 
336337  toJSON ( ) : Return [ 'toJSON' ]  { 
338+     if  ( ! ES . IsTemporalCalendar ( this ) )  throw  new  TypeError ( 'invalid receiver' ) ; 
337339    return  ES . ToString ( this ) ; 
338340  } 
339341  static  from ( item : Params [ 'from' ] [ 0 ] ) : Return [ 'from' ]  { 
Original file line number Diff line number Diff line change @@ -324,6 +324,7 @@ function ParseISODateTime(isoString: string) {
324324  if  ( ! match )  throw  new  RangeError ( `invalid ISO 8601 string: ${ isoString }  ` ) ; 
325325  let  yearString  =  match [ 1 ] ; 
326326  if  ( yearString [ 0 ]  ===  '\u2212' )  yearString  =  `-${ yearString . slice ( 1 ) }  ` ; 
327+   if  ( yearString  ===  '-000000' )  throw  new  RangeError ( `invalid ISO 8601 string: ${ isoString }  ` ) ; 
327328  const  year  =  ToInteger ( yearString ) ; 
328329  const  month  =  ToInteger ( match [ 2 ]  ||  match [ 4 ] ) ; 
329330  const  day  =  ToInteger ( match [ 3 ]  ||  match [ 5 ] ) ; 
@@ -451,6 +452,7 @@ function ParseTemporalYearMonthString(isoString: string) {
451452  if  ( match )  { 
452453    let  yearString  =  match [ 1 ] ; 
453454    if  ( yearString [ 0 ]  ===  '\u2212' )  yearString  =  `-${ yearString . slice ( 1 ) }  ` ; 
455+     if  ( yearString  ===  '-000000' )  throw  new  RangeError ( `invalid ISO 8601 string: ${ isoString }  ` ) ; 
454456    year  =  ToInteger ( yearString ) ; 
455457    month  =  ToInteger ( match [ 2 ] ) ; 
456458    calendar  =  match [ 3 ] ; 
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export class TimeZone implements Temporal.TimeZone {
4343    } 
4444  } 
4545  get  id ( ) : Return [ 'id' ]  { 
46+     if  ( ! ES . IsTemporalTimeZone ( this ) )  throw  new  TypeError ( 'invalid receiver' ) ; 
4647    return  ES . ToString ( this ) ; 
4748  } 
4849  getOffsetNanosecondsFor ( instantParam : Params [ 'getOffsetNanosecondsFor' ] [ 0 ] ) : Return [ 'getOffsetNanosecondsFor' ]  { 
@@ -150,6 +151,7 @@ export class TimeZone implements Temporal.TimeZone {
150151    return  ES . ToString ( GetSlot ( this ,  TIMEZONE_ID ) ) ; 
151152  } 
152153  toJSON ( ) : Return [ 'toJSON' ]  { 
154+     if  ( ! ES . IsTemporalTimeZone ( this ) )  throw  new  TypeError ( 'invalid receiver' ) ; 
153155    return  ES . ToString ( this ) ; 
154156  } 
155157  static  from ( item : Params [ 'from' ] [ 0 ] ) : Return [ 'from' ]  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments