main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
584 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | module.exports = function (fromEntries, t) {
|
---|
4 | var a = {};
|
---|
5 | var b = {};
|
---|
6 | var c = {};
|
---|
7 | var entries = [['a', a], ['b', b], ['c', c]];
|
---|
8 | var obj = { a: a, b: b, c: c };
|
---|
9 |
|
---|
10 | t.deepEqual(fromEntries(entries), obj, 'entries -> obj');
|
---|
11 |
|
---|
12 | t['throws'](function () { fromEntries(); }, 'entries throws on absent iterable');
|
---|
13 | t['throws'](function () { fromEntries(undefined); }, 'entries throws on undefined');
|
---|
14 | t['throws'](function () { fromEntries(null); }, 'entries throws on null');
|
---|
15 |
|
---|
16 | t.deepEqual(fromEntries([['foo', 1], ['foo', 2]]), { foo: 2 }, 'works with a duplicate key');
|
---|
17 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.