Skip to content
4 changes: 4 additions & 0 deletions source/units/Goccia.AST.Statements.pas
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ TGocciaClassElement = record
TGocciaFieldOrderEntry = record
Name: string;
IsPrivate: Boolean;
IsComputed: Boolean;
ElementIndex: Integer;
ComputedKeyExpression: TGocciaExpression;
FieldInitializer: TGocciaExpression;
end;

// Shared class definition structure
Expand Down
3 changes: 3 additions & 0 deletions source/units/Goccia.Bytecode.OpCodeNames.pas
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ function OpCodeName(const AOp: UInt8): string;
OP_DEFINE_STATIC_METHOD_CONST: Result := 'OP_DEFINE_STATIC_METHOD_CONST';
OP_DEFINE_DATA_PROP: Result := 'OP_DEFINE_DATA_PROP';
OP_DEFINE_METHOD_PROP: Result := 'OP_DEFINE_METHOD_PROP';
OP_DEFINE_PROP_DYNAMIC: Result := 'OP_DEFINE_PROP_DYNAMIC';
OP_ADD: Result := 'OP_ADD';
OP_SUB: Result := 'OP_SUB';
OP_MUL: Result := 'OP_MUL';
OP_DIV: Result := 'OP_DIV';
OP_MOD: Result := 'OP_MOD';
OP_POW: Result := 'OP_POW';
OP_SETUP_AUTO_ACCESSOR_DYNAMIC: Result := 'OP_SETUP_AUTO_ACCESSOR_DYNAMIC';
OP_BAND: Result := 'OP_BAND';
OP_BOR: Result := 'OP_BOR';
OP_BXOR: Result := 'OP_BXOR';
Expand All @@ -170,6 +172,7 @@ function OpCodeName(const AOp: UInt8): string;
OP_CREATE_ARGUMENTS: Result := 'OP_CREATE_ARGUMENTS';
OP_TO_OBJECT: Result := 'OP_TO_OBJECT';
OP_HAS_WITH_BINDING: Result := 'OP_HAS_WITH_BINDING';
OP_TO_PROPERTY_KEY: Result := 'OP_TO_PROPERTY_KEY';
OP_INC: Result := 'OP_INC';
OP_DEC: Result := 'OP_DEC';
OP_TO_NUMERIC: Result := 'OP_TO_NUMERIC';
Expand Down
13 changes: 11 additions & 2 deletions source/units/Goccia.Bytecode.pas
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ interface
// own data properties instead of assigning through prototypes.
// v33 -> v34: added OP_DEFINE_METHOD_PROP so concise object methods get
// [[HomeObject]] without affecting plain data properties.
GOCCIA_FORMAT_VERSION = 34;
// v34 -> v35: added OP_DEFINE_PROP_DYNAMIC for computed public
// class fields.
// v35 -> v36: added OP_TO_PROPERTY_KEY so delayed computed class field
// definitions can reuse source-order property keys.
// v36 -> v37: added OP_SETUP_AUTO_ACCESSOR_DYNAMIC for computed
// auto-accessor keys.
GOCCIA_FORMAT_VERSION = 37;
GOCCIA_BINARY_MAGIC: array[0..3] of Byte = (Ord('G'), Ord('B'), Ord('C'), 0);
GOCCIA_NULLISH_MATCH_UNDEFINED = 0;
GOCCIA_NULLISH_MATCH_NULL = 1;
Expand Down Expand Up @@ -222,12 +228,14 @@ interface
OP_DEFINE_STATIC_METHOD_CONST = 124,
OP_DEFINE_DATA_PROP = 125,
OP_DEFINE_METHOD_PROP = 126,
OP_DEFINE_PROP_DYNAMIC = 127,
OP_ADD = 128,
OP_SUB = 129,
OP_MUL = 130,
OP_DIV = 131,
OP_MOD = 132,
OP_POW = 133,
OP_SETUP_AUTO_ACCESSOR_DYNAMIC = 134,
OP_BAND = 135,
OP_BOR = 136,
OP_BXOR = 137,
Expand All @@ -251,7 +259,8 @@ interface
OP_NEW_TARGET = 181,
OP_CREATE_ARGUMENTS = 182,
OP_TO_OBJECT = 183,
OP_HAS_WITH_BINDING = 184
OP_HAS_WITH_BINDING = 184,
OP_TO_PROPERTY_KEY = 185
);

function EncodeABC(const AOp: TGocciaOpCode; const A, B, C: UInt8): UInt32; inline;
Expand Down
Loading
Loading