test262/test/built-ins/Object/fromEntries/empty-iterable.js

20 lines
615 B
JavaScript
Raw Normal View History

2018-08-11 08:16:46 +02:00
// Copyright (C) 2018 Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-object.fromentries
description: When given an empty list, makes an empty object.
info: |
Object.fromEntries ( iterable )
...
4. Let stepsDefine be the algorithm steps defined in CreateDataPropertyOnObject Functions.
5. Let adder be CreateBuiltinFunction(stepsDefine, « »).
6. Return ? AddEntriesFromIterable(obj, iterable, adder).
2018-08-11 08:16:46 +02:00
features: [Object.fromEntries]
---*/
var result = Object.fromEntries([]);
assert.sameValue(Object.keys(result).length, 0);