You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice to have coverage when the built-in Array iteration has been modified to ensure implementations correctly handle this case in CalendarFields and GetPossibleInstantsFor.
CalendarFields:
letobserved=[];letArrayIterProto=Object.getPrototypeOf([][Symbol.iterator]());letoldNext=ArrayIterProto.next;ArrayIterProto.next=function(){varr=oldNext.call(this);if(!r.done){observed.push(r.value);}returnr;};// No overridden `fields` methods, but calling CalendarFields is still observable through// modified Array iteration.letcalendar=newTemporal.Calendar("iso8601");letpd=newTemporal.PlainDate(2000,1,1,calendar).with({year: 2001});// Should output: day,month,monthCode,year,day,month,monthCode,yearconsole.log(observed);
GetPossibleInstantsFor:
letobserved=[];letArrayIterProto=Object.getPrototypeOf([][Symbol.iterator]());letoldNext=ArrayIterProto.next;ArrayIterProto.next=function(){varr=oldNext.call(this);if(!r.done){observed.push(r.value);}returnr;};// No overridden `getPossibleInstantsFor` methods, but calling GetPossibleInstantsFor is still// observable through modified Array iteration.lettimeZone=newTemporal.TimeZone("UTC");letpd=newTemporal.PlainDate(2000,1,1);letzdt=pd.toZonedDateTime(timeZone);// Should print: 2000-01-01T00:00:00Z// Note: `observed[0]` is a Temporal.Instant value.console.log(observed);
The text was updated successfully, but these errors were encountered:
After tc39/proposal-temporal#2657 we'll have no observable array iteration if the called fields method is from a built-in calendar. It's already the case that we have no observable array iteration if the called getPossibleInstantsFor method is from a built-in time zone.
ed3a092 adds coverage for builtin fieldsnot observably calling Array.prototype[Symbol.iterator].
So, to fulfill this issue we would still need to add coverage for:
It'd be nice to have coverage when the built-in Array iteration has been modified to ensure implementations correctly handle this case in CalendarFields and GetPossibleInstantsFor.
CalendarFields:
GetPossibleInstantsFor:
The text was updated successfully, but these errors were encountered: