Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record.fromEntries argument type assertion #78

Open
unadlib opened this issue Apr 6, 2022 · 1 comment
Open

Record.fromEntries argument type assertion #78

unadlib opened this issue Apr 6, 2022 · 1 comment

Comments

@unadlib
Copy link

unadlib commented Apr 6, 2022

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
@acutmore
Copy link
Contributor

Hi @unadlib

There is a chance that the spec will be updated to accept tuples here: tc39/proposal-record-tuple#107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants