tc39 / test262

Official ECMAScript Conformance Test Suite
Other
2.39k stars 464 forks source link

argument-propertybag-calendar-number tests are invalid #3553

Closed FrankYFTang closed 2 years ago

FrankYFTang commented 2 years ago

The following tests landed by @ptomato are invalid.

test/intl402/DateTimeFormat/constructor-calendar-numberingSystem-order.js
test/intl402/Temporal/Calendar/prototype/eraYear/argument-propertybag-calendar-number.js
test/intl402/Temporal/Calendar/prototype/era/argument-propertybag-calendar-number.js
test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-number.js
test/built-ins/Temporal/TimeZone/prototype/getPossibleInstantsFor/argument-propertybag-calendar-number.js
test/built-ins/Temporal/TimeZone/prototype/getInstantFor/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainYearMonth/from/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainYearMonth/calendar-number.js
test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Now/plainDate/calendar-number.js
test/built-ins/Temporal/Now/zonedDateTime/calendar-number.js
test/built-ins/Temporal/Now/plainDateTime/calendar-number.js
test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-number.js
test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-number.js
test/built-ins/Temporal/ZonedDateTime/calendar-number.js
test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-number.js
test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-number.js
test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-number.js
test/built-ins/Temporal/ZonedDateTime/prototype/withPlainDate/argument-propertybag-calendar-number.js
test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-number.js
test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDateTime/calendar-number.js
test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDateTime/prototype/withPlainDate/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-number.js
test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-number.js
test/built-ins/Temporal/PlainMonthDay/from/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainMonthDay/calendar-number.js
test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/from/calendar-number.js
test/built-ins/Temporal/Calendar/prototype/month/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/weekOfYear/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/daysInMonth/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/daysInWeek/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/daysInYear/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/day/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/monthsInYear/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/dayOfWeek/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/inLeapYear/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/monthCode/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/year/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Calendar/prototype/dayOfYear/argument-propertybag-calendar-number.js
test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-number.js
test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-number.js
test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-number.js
test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-number.js
test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainTime/prototype/toPlainDateTime/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDate/calendar-number.js
test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-number.js
test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-number.js

All of them have the following pattern as the first several lines for setup the test

const instance = new Temporal.TimeZone("UTC");

const calendar = 19970327;

let arg = { year: 1976, monthCode: "M11", day: 18, calendar };

and then use arg but 19970327 will be converted to String in step 2 of ToTemporalCalendar https://tc39.es/proposal-temporal/#sec-temporal-totemporalcalendar and become "19970327" then in step3 IsBuiltinCalendar ( "19970327") will return false and step 3a it will call a. Set identifier to ? ParseTemporalCalendarString("19970327")

now inside ParseTemporalCalendarString https://tc39.es/proposal-temporal/#sec-temporal-parsetemporalcalendarstring Step 1 and 2 will be run and there are no Error

and ParseTemporalCalendarString("19970327") will return "19970327" but not "iso8601". and then in step 3b of ToTemporalCalendar it will call IsBuiltinCalendar("19970327" ) again and throw the RangeError b. If IsBuiltinCalendar(identifier) is false, throw a RangeError exception.

And none of the step after that setup will be run.

FrankYFTang commented 2 years ago

@ajklein (FYI- in case you wonder why some of my v8 implementation does not pass some test262 tests- Sometime the tests are invalid)

anba commented 2 years ago

This is tracked in https://github.com/tc39/proposal-temporal/issues/2165.

ptomato commented 2 years ago

tc39/proposal-temporal#2165 is closed, resolved in such a way that makes these tests valid. I think this can be closed.