record-tuple-polyfill icon indicating copy to clipboard operation
record-tuple-polyfill copied to clipboard

Record.fromEntries argument type assertion

Open unadlib opened this issue 3 years ago • 1 comments

Describe the bug It's Record.fromEntries argument type assertion issue, which is an array-like object for each item in its argument.

To Reproduce

const record = Record.fromEntries([["a", 1], #["b", 2], "c3"]);
console.log(record);
// print:  Record {a: 1, b: 2, c: "3"}

Expected behavior In terms of Record.fromEntries spec, it should throw this error.

Uncaught TypeError: Iterator value c3 is not an entry object

unadlib avatar Apr 06 '22 16:04 unadlib

Hi @unadlib

There is a chance that the spec will be updated to accept tuples here: https://github.com/tc39/proposal-record-tuple/issues/107

acutmore avatar Jul 15 '22 18:07 acutmore