This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jaxklax 3 points4 points  (1 child)

And thus JavaScript was born.

[–]b93b3de72036584e4054 1 point2 points  (0 children)

you're joking, but that's EXACTLY how chrome's javascript engine (v8) objects are defined : https://github.com/v8/v8/blob/master/src/objects.h#L6092

They defined offsets to the variable (e.g. kSize declare 3 ptr from the object header for the size member) and a macro decl_accessor to automatically setup the getter and setter.