- <emu-alg><ol><li>Let <var>handleEra</var> be <emu-xref aoid="IsCalendarSupportEra" id="_ref_10"><a href="#sec-temporal-iscalendarsupportera">IsCalendarSupportEra</a></emu-xref>(_calendar).</li><li>Let <var>merged</var> be <emu-xref aoid="OrdinaryObjectCreate"><a href="https://tc39.es/ecma262/#sec-ordinaryobjectcreate">OrdinaryObjectCreate</a></emu-xref>(<emu-xref href="#sec-properties-of-the-object-prototype-object"><a href="https://tc39.es/ecma262/#sec-properties-of-the-object-prototype-object">%Object.prototype%</a></emu-xref>).</li><li>Let <var>fieldsKeys</var> be ? <emu-xref aoid="EnumerableOwnPropertyNames"><a href="https://tc39.es/ecma262/#sec-enumerableownpropertynames">EnumerableOwnPropertyNames</a></emu-xref>(<var>fields</var>, <emu-const>key</emu-const>).</li><li>For each element <var>key</var> of <var>fieldsKeys</var>, do<ol><li>If <var>key</var> is not <emu-val>"month"</emu-val> or <emu-val>"monthCode"</emu-val>, then<ol><li>If <var>handlEra</var> is <emu-val>false</emu-val> or <var>key</var> is not <emu-val>"era"</emu-val>, <emu-val>"eraYear"</emu-val> or <emu-val>"year"</emu-val>, then<ol><li>Let <var>propValue</var> be ? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>fields</var>, <var>key</var>).</li><li>If <var>propValue</var> is not <emu-val>undefined</emu-val>, then<ol><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>merged</var>, <var>key</var>, <var>propValue</var>).</li></ol></li></ol></li></ol></li></ol></li><li>Let <var>additionalFieldsKeys</var> be ? <emu-xref aoid="EnumerableOwnPropertyNames"><a href="https://tc39.es/ecma262/#sec-enumerableownpropertynames">EnumerableOwnPropertyNames</a></emu-xref>(<var>additionalFields</var>, <emu-const>key</emu-const>).</li><li>For each element <var>key</var> of <var>additionalFieldsKeys</var>, do<ol><li>Let <var>propValue</var> be ? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>additionalFields</var>, <var>key</var>).</li><li>If <var>propValue</var> is not <emu-val>undefined</emu-val>, then<ol><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>merged</var>, <var>key</var>, <var>propValue</var>).</li></ol></li></ol></li><li>If <var>additionalFieldsKeys</var> does not contain either <emu-val>"month"</emu-val> or <emu-val>"monthCode"</emu-val>, then<ol><li>Let <var>month</var> be ? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>fields</var>, <emu-val>"month"</emu-val>).</li><li>If <var>month</var> is not <emu-val>undefined</emu-val>, then<ol><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>merged</var>, <emu-val>"month"</emu-val>, <var>month</var>).</li></ol></li><li>Let <var>monthCode</var> be ? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>fields</var>, <emu-val>"monthCode"</emu-val>).</li><li>If <var>monthCode</var> is not <emu-val>undefined</emu-val>, then<ol><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>merged</var>, <emu-val>"monthCode"</emu-val>, <var>monthCode</var>).</li></ol></li></ol></li><li>If <var>handleEra</var> is <emu-val>true</emu-val>, then<ol><li>If <var>additionalFieldsKeys</var> does not contain <emu-val>"era"</emu-val>, <emu-val>"eraYear"</emu-val>, or <emu-val>"year"</emu-val>, then<ol><li>Let <var>year</var> be ? <emu-xref aoid="Get"><a href="https://tc39.es/ecma262/#sec-get-o-p">Get</a></emu-xref>(<var>fields</var>, <emu-val>"year"</emu-val>).</li><li>If <var>year</var> is not <emu-val>undefined</emu-val>, then<ol><li>Perform ! <emu-xref aoid="CreateDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createdatapropertyorthrow">CreateDataPropertyOrThrow</a></emu-xref>(<var>merged</var>, <emu-val>"year"</emu-val>, <var>year</var>).</li></ol></li></ol></li></ol></li><li>Return <var>merged</var>.</li></ol></emu-alg>
0 commit comments