Boa: Refactoring `Property` flags

Created on 15 Jun 2020  路  3Comments  路  Source: boa-dev/boa

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.

enhancement help wanted technical debt discussion

All 3 comments

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

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

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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Razican picture Razican  路  5Comments

Razican picture Razican  路  4Comments

IovoslavIovchev picture IovoslavIovchev  路  4Comments

joshwd36 picture joshwd36  路  4Comments

jasonwilliams picture jasonwilliams  路  6Comments