- 
                Notifications
    
You must be signed in to change notification settings  - Fork 172
 
Description
The spec for PrepareTemporalFields says:
- Assert: Type(fields) is Object.
 
But the polyfill for this AO treats non-Object values as OK.
  PrepareTemporalFields: (bag, fields) => {
    if (ES.Type(bag) !== 'Object') return false;Why does the polyfill accept a non-Object parameter without throwing while the spec says that that a non-Object parameter is disallowed?
I assume this is a bug, but wanted to make sure before PR-ing a change. And assuming it's a bug, I assume that the spec is correct but the polyfill is wrong?
Tracking the git blame on this change was fun because this AO has changed its name many times, but looks like this return false case was introduced in #346 by @ptomato when the name of the AO was ValidDateTimeFrom, which then was changed to ToRecord, and which finally ended up as PrepareTemporalFields.  At least that's what I think the provenance was! 🤷♂️
BTW this was exposed by the TS work that @jens-ox is doing over in js-temporal/temporal-polyfill#103 to remove unexpected undefineds from the TS codebase.