summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/fromEntries/empty-iterable.js
blob: 12dce89cac93a2498d68e045e425cb959f200182 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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).

features: [Object.fromEntries]
---*/

var result = Object.fromEntries([]);
assert.sameValue(Object.keys(result).length, 0);

reportCompare(0, 0);