- <emu-alg><ol><li>Let <var>str</var> be ? ToString(<var>input</var>).</li><li>Let <var>selectKeyClosure</var> be a new Abstract Closure with parameters (<var>keys</var>) that captures <var>str</var> and performs the following steps when called:<ol><li>Let <var>keyList</var> be ? CreateListFromArrayLike(<var>keys</var>, « String »).</li><li>If <var>keyList</var> contains <var>str</var>, return <var>str</var>.</li><li>Else, return <emu-val>null</emu-val>.</li></ol></li><li>Let <var>selectKey</var> be CreateBuiltinFunction(<var>selectKeyClosure</var>, <emu-val>1</emu-val>, <emu-val>"selectKey"</emu-val>, « »).</li><li>Let <var>toPartsClosure</var> be a new Abstract Closure with no parameters that captures <var>funcCtx</var> and <var>str</var> and performs the following steps when called:<ol><li>Let <var>source</var> be ! Get(<var>funcCtx</var>, <emu-val>"source"</emu-val>).</li><li>Let <var>locale</var> be ! Get(<var>funcCtx</var>, <emu-val>"locale"</emu-val>).</li><li>Let <var>locale0</var> be ! Get(<var>locale</var>, <emu-val>"0"</emu-val>).</li><li>Let <var>result</var> be OrdinaryObjectCreate(%Object.prototype%).</li><li>Perform ! CreateDataPropertyOrThrow(<var>result</var>, <emu-val>"type"</emu-val>, <emu-val>"string"</emu-val>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>result</var>, <emu-val>"source"</emu-val>, <var>source</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>result</var>, <emu-val>"locale"</emu-val>, <var>locale0</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>result</var>, <emu-val>"value"</emu-val>, <var>str</var>).</li><li>Return CreateArrayFromList(« <var>result</var> »).</li></ol></li><li>Let <var>toParts</var> be CreateBuiltinFunction(<var>toPartsClosure</var>, <emu-val>0</emu-val>, <emu-val>"toParts"</emu-val>, « »).</li><li>Let <var>toStringClosure</var> be a new Abstract Closure with no parameters that captures <var>str</var> and performs the following steps when called:<ol><li>Return <var>str</var>.</li></ol></li><li>Let <var>toString</var> be CreateBuiltinFunction(<var>toStringClosure</var>, <emu-val>0</emu-val>, <emu-val>"toString"</emu-val>, « »).</li><li>Let <var>valueOf</var> be CreateBuiltinFunction(<var>toStringClosure</var>, <emu-val>0</emu-val>, <emu-val>"valueOf"</emu-val>, « »).</li><li>Let <var>mv</var> be OrdinaryObjectCreate(%Object.prototype%).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"type"</emu-val>, <emu-val>"number"</emu-val>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"source"</emu-val>, <var>source</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"locale"</emu-val>, <var>numberFormat</var>.<var class="field">[[Locale]]</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"options"</emu-val>, <var>opts</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"selectKey"</emu-val>, <var>selectKey</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"toParts"</emu-val>, <var>toParts</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"toString"</emu-val>, <var>toString</var>).</li><li>Perform ! CreateDataPropertyOrThrow(<var>mv</var>, <emu-val>"valueOf"</emu-val>, <var>valueOf</var>).</li><li>Return <var>mv</var>.</li></ol></emu-alg>
0 commit comments