From 60b9467630a7b4899058e3ad74eb88c3ecb08a40 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 10 Aug 2018 23:16:46 -0700 Subject: [PATCH] Two more simple tests --- test/built-ins/Object/fromEntries/empty-iterable.js | 11 +++++++++++ test/built-ins/Object/fromEntries/prototype.js | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/built-ins/Object/fromEntries/empty-iterable.js create mode 100644 test/built-ins/Object/fromEntries/prototype.js diff --git a/test/built-ins/Object/fromEntries/empty-iterable.js b/test/built-ins/Object/fromEntries/empty-iterable.js new file mode 100644 index 0000000000..0ba1b950db --- /dev/null +++ b/test/built-ins/Object/fromEntries/empty-iterable.js @@ -0,0 +1,11 @@ +// Copyright (C) 2018 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: When given an empty list, makes an empty object. +esid: sec-object.fromentries +features: [Object.fromEntries] +---*/ + +var result = Object.fromEntries([]); +assert.sameValue(Object.keys(result).length, 0); diff --git a/test/built-ins/Object/fromEntries/prototype.js b/test/built-ins/Object/fromEntries/prototype.js new file mode 100644 index 0000000000..0ad197d306 --- /dev/null +++ b/test/built-ins/Object/fromEntries/prototype.js @@ -0,0 +1,11 @@ +// Copyright (C) 2018 Kevin Gibbons. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: Created objects inherit from Object.prototype. +esid: sec-object.fromentries +features: [Object.fromEntries] +---*/ + +var result = Object.fromEntries([]); +assert.sameValue(Object.getPrototypeOf(result), Object.prototype);