-
Notifications
You must be signed in to change notification settings - Fork 174
Closed
Labels
behaviorRelating to behavior defined in the proposalRelating to behavior defined in the proposalbugnormativeWould be a normative change to the proposalWould be a normative change to the proposalspec-textSpecification text involvedSpecification text involved
Description
I haven't checked how recent or how widespread this is, but the current spec text exposes internal branching by how it consumes an options object in at least Temporal.PlainDate.from, Temporal.PlainDateTime.from, Temporal.PlainYearMonth.from, Temporal.PlainMonthDay.from, and Temporal.ZonedDateTime.from, e.g.
const zdtString = "2024-05-21T12:00[America/New_York]";
const makeSpy = () => new Proxy({ log: [] }, {
ownKeys: obj => obj.log.push("[[OwnPropertyKeys]]") && ["disambiguation", "offset", "overflow", "log"].reverse(),
getOwnPropertyDescriptor: (obj, key) => obj.log.push(`[[GetOwnProperty]] ${key}`) &&
{ value: undefined, writable: true, enumerable: true, configurable: true },
get: (obj, key) => obj.log.push(`[[Get]] ${key}`) && obj[key],
});
const spy1 = makeSpy(), spy2 = makeSpy();
Temporal.ZonedDateTime.from(Temporal.ZonedDateTime.from(zdtString), spy1);
Temporal.ZonedDateTime.from(zdtString, spy2);
spy1.log.slice(0, -1);
/* => [
'[[Get]] disambiguation',
'[[Get]] offset',
'[[Get]] overflow',
] */
spy2.log.slice(0, -1);
/* => [
'[[OwnPropertyKeys]]',
'[[GetOwnProperty]] log',
'[[Get]] log',
'[[GetOwnProperty]] overflow',
'[[Get]] overflow',
'[[GetOwnProperty]] offset',
'[[Get]] offset',
'[[GetOwnProperty]] disambiguation',
'[[Get]] disambiguation',
] */All of these functions should SnapshotOwnProperties up front, passing down an unobservable clone to later steps and deeper operations.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
behaviorRelating to behavior defined in the proposalRelating to behavior defined in the proposalbugnormativeWould be a normative change to the proposalWould be a normative change to the proposalspec-textSpecification text involvedSpecification text involved