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

Override property enumeration behavior for dom.Struct #629

Open
zslayton opened this issue Sep 15, 2020 · 0 comments
Open

Override property enumeration behavior for dom.Struct #629

zslayton opened this issue Sep 15, 2020 · 0 comments

Comments

@zslayton
Copy link
Contributor

dom.Struct uses a Proxy object to intercept field gets, sets, and deletes. It also defines its own iterator logic to customize the behavior of for ... of loops, guaranteeing that programs will iterate over the expected key/value pairs.

However, dom.Struct does not override the behavior of for ... in loops (i.e. property enumeration). While these are not commonly used with Objects, they are used in the implementation of Object.entries(), which is more popular.

I believe we can achieve the desired effect by providing an implementation of the ownKeys trap.

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

No branches or pull requests

1 participant