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

Array like syntax support #126

Closed
krichprollsch opened this issue Oct 26, 2023 · 0 comments · Fixed by #154
Closed

Array like syntax support #126

krichprollsch opened this issue Oct 26, 2023 · 0 comments · Fixed by #154
Labels
feature New feature or request Investigate
Milestone

Comments

@krichprollsch
Copy link
Member

Many DOM objects like HTMLCollection [1] supports array like usage with square brackets

Example from MDN

let elem1, elem2;

// document.forms is an HTMLCollection

elem1 = document.forms[0];
elem2 = document.forms.item(0);

alert(elem1 === elem2); // shows: "true"

elem1 = document.forms.myForm;
elem2 = document.forms.namedItem("myForm");

alert(elem1 === elem2); // shows: "true"

elem1 = document.forms["named.item.with.periods"];

jsruntime-lib should allow to implement the array like syntax (getter and setter) with a native struct.

@krichprollsch krichprollsch added this to the Alpha milestone Oct 26, 2023
@krichprollsch krichprollsch changed the title ArrayLike support Array like support Oct 26, 2023
@krichprollsch krichprollsch changed the title Array like support Array like syntax support Oct 26, 2023
@francisbouvier francisbouvier added feature New feature or request Investigate labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request Investigate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants