Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: add Object.fromEntries #1274

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -24101,6 +24101,34 @@ <h1>Object.defineProperty ( _O_, _P_, _Attributes_ )</h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-object.fromentries">
<h1>Object.fromEntries ( iterable )</h1>
<p>When the `fromEntries` method is called with argument _iterable_, the following steps are taken:</p>
<emu-alg>
1. Perform ? RequireObjectCoercible(_iterable_).
1. Let _obj_ be ObjectCreate(%ObjectPrototype%).
1. Assert: _obj_ is an extensible ordinary object with no own properties.
1. Let _stepsDefine_ be the algorithm steps defined in <emu-xref href="#sec-create-data-property-on-object-functions">CreateDataPropertyOnObject Functions</emu-xref>.
1. Let _adder_ be CreateBuiltinFunction(_stepsDefine_, &laquo; &raquo;).
1. Return ? AddEntriesFromIterable(_obj_, _iterable_, _adder_).
</emu-alg>
<emu-note>
The function created for _adder_ is never directly accessible to ECMAScript code.
</emu-note>

<emu-clause id="sec-create-data-property-on-object-functions">
<h1>CreateDataPropertyOnObject Functions</h1>
<p>A CreateDataPropertyOnObject function is an anonymous built-in function. When a CreateDataPropertyOnObject function is called with arguments _key_ and _value_, the following steps are taken:</p>
<emu-alg>
1. Let _O_ be the *this* value.
1. Assert: Type(_O_) is Object.
1. Assert: _O_ is an extensible ordinary object.
1. Let _propertyKey_ be ? ToPropertyKey(_key_).
1. Perform ! CreateDataPropertyOrThrow(_O_, _propertyKey_, _value_).
<emu-alg>
</emu-clause>
</emu-clause>

<emu-clause id="sec-object.entries">
<h1>Object.entries ( _O_ )</h1>
<p>When the `entries` function is called with argument _O_, the following steps are taken:</p>
Expand Down