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

ClipboardItem constructor should throw when items are empty #169

Closed
mbrodesser opened this issue Feb 14, 2022 · 4 comments
Closed

ClipboardItem constructor should throw when items are empty #169

mbrodesser opened this issue Feb 14, 2022 · 4 comments

Comments

@mbrodesser
Copy link

const c = new ClipboardItem([]);

Chrome and Firefox both throw a TypeError. The spec doesn't cover this case.

CC @snianu
Keeping this separate from #158 to not widen its scope.

@mbrodesser mbrodesser changed the title ClipboardItem constructor should throw when items is empty ClipboardItem constructor should throw when items are empty Feb 14, 2022
@snianu
Copy link
Contributor

snianu commented Feb 14, 2022

@mbrodesser Ah you are right. It should throw a TypeError. I can add it to the spec if you want, but if this needs further discussion then we can do this in a separate PR.

@mbrodesser
Copy link
Author

@snianu let's pull #158 first. This is a minor issue.

@EdgarChen
Copy link

Now spec throws TypeError when items is empty after #158, i.e.

The new ClipboardItem(items, options) constructor steps are:
If items is empty, then throw a TypeError.

Could we close this?

@snianu
Copy link
Contributor

snianu commented Aug 26, 2022

I think we can close this. Thanks for the reminder!

@snianu snianu closed this as completed Aug 26, 2022
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

3 participants