From 3e2943d9cbf49b9352f60c17e494d8079c1bdfd0 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 20 Feb 2019 13:41:51 -0800 Subject: [PATCH] Normative: add `Object.fromEntries` (#1274) --- spec.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/spec.html b/spec.html index 35629a979b..e3e78f03d4 100644 --- a/spec.html +++ b/spec.html @@ -24195,6 +24195,34 @@

Object.defineProperty ( _O_, _P_, _Attributes_ )

+ +

Object.fromEntries ( iterable )

+

When the `fromEntries` method is called with argument _iterable_, the following steps are taken:

+ + 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 CreateDataPropertyOnObject Functions. + 1. Let _adder_ be CreateBuiltinFunction(_stepsDefine_, « »). + 1. Return ? AddEntriesFromIterable(_obj_, _iterable_, _adder_). + + + The function created for _adder_ is never directly accessible to ECMAScript code. + + + +

CreateDataPropertyOnObject Functions

+

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:

+ + 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_). + +
+
+

Object.entries ( _O_ )

When the `entries` function is called with argument _O_, the following steps are taken: