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

Refactor Class API #3314

Open
5 of 7 tasks
jedel1043 opened this issue Sep 27, 2023 · 0 comments
Open
5 of 7 tasks

Refactor Class API #3314

jedel1043 opened this issue Sep 27, 2023 · 0 comments
Assignees
Labels
API enhancement New feature or request

Comments

@jedel1043
Copy link
Member

jedel1043 commented Sep 27, 2023

Right now our Class and ClassBuilder API is a lot stricter than its equivalent ConstructorBuilder, which makes ClassBuilder a bit clunkier to use. Ideally we should integrate all ConstructorBuilder's APIs with ClassBuilder, and also add some more features to make ClassBuilder a bit nicer to use. Specifically:

  • Allow using any PropertyKey as the name of a method. (Introduce a Class map #3315)
  • Allow changing the base object of the generated constructor object.
  • Allow deriving from other classes.
  • Integrate a "class map" of sorts to easily access the registered classes (Possibly using Implement [[HostDefined]] field on Realms #2952) (Introduce a Class map #3315).
  • Allow modifying the JsObject wrapping the NativeObject constructed.
  • Change the argument name this to new_target and document that this is not the constructed object, but the parent constructor.
  • Allow creating an object from the raw Class data (Class::from_data maybe?)
@jedel1043 jedel1043 added enhancement New feature or request API labels Sep 27, 2023
@jedel1043 jedel1043 moved this to To do in Boa pre-v1 Sep 27, 2023
@jedel1043 jedel1043 moved this from To do to In Progress in Boa pre-v1 Sep 30, 2023
@jedel1043 jedel1043 self-assigned this Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant