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

Refactoring Property flags #497

Closed
HalidOdat opened this issue Jun 15, 2020 · 3 comments · Fixed by #553
Closed

Refactoring Property flags #497

HalidOdat opened this issue Jun 15, 2020 · 3 comments · Fixed by #553
Assignees
Labels
discussion Issues needing more discussion enhancement New feature or request help wanted Extra attention is needed technical debt
Milestone

Comments

@HalidOdat
Copy link
Member

HalidOdat commented Jun 15, 2020

Make the flags instead of Option we combine all the flags into one u8 and store and access the bits this should shrink the size of Property.

@HalidOdat HalidOdat added enhancement New feature or request technical debt blocked Waiting for another code change labels Jun 15, 2020
@HalidOdat HalidOdat added this to the v0.9.0 milestone Jun 15, 2020
@HalidOdat HalidOdat self-assigned this Jun 15, 2020
@HalidOdat HalidOdat changed the title Refactoring Property (getters /setters) Refactoring Property (getters and setters) Jun 15, 2020
@HalidOdat HalidOdat added discussion Issues needing more discussion help wanted Extra attention is needed labels Jun 15, 2020
@HalidOdat HalidOdat changed the title Refactoring Property (getters and setters) Refactoring Property (adding getters and setters) Jun 15, 2020
@Razican
Copy link
Member

Razican commented Jun 15, 2020

For the flags, we can use bitflags, as we do with the regex lexer.

@jasonwilliams
Copy link
Member

The spec has the concept of a default property which we can surface with Default:
https://tc39.es/ecma262/#table-default-attribute-values

@jasonwilliams
Copy link
Member

jasonwilliams commented Jun 17, 2020

Make Accessor getter and setter store a Function instead of Value because there always going to be functions

I don't think this will work because those functions are exposed to the outside world, so if someone does a typeof check it would fail.

const object1 = { property1: 42 };
Object.defineProperty(object1, 'prop2', { get: () => {return "blah"}});
typeof Object.getOwnPropertyDescriptor(object1, 'prop2').get; // function

@jasonwilliams jasonwilliams modified the milestones: v0.9.0, v0.10.0 Jun 17, 2020
@HalidOdat HalidOdat removed the blocked Waiting for another code change label Jul 19, 2020
@HalidOdat HalidOdat changed the title Refactoring Property (adding getters and setters) Refactoring Property flags Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Issues needing more discussion enhancement New feature or request help wanted Extra attention is needed technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants