@@ -3844,6 +3844,10 @@ declare module "assemblyscript/src/program" {
3844
3844
prototype : FieldPrototype ;
3845
3845
/** Field memory offset, if an instance field. */
3846
3846
memoryOffset : number ;
3847
+ /** Getter function reference, if compiled. */
3848
+ getterRef : FunctionRef ;
3849
+ /** Setter function reference, if compiled. */
3850
+ setterRef : FunctionRef ;
3847
3851
/** Constructs a new field. */
3848
3852
constructor (
3849
3853
/** Respective field prototype. */
@@ -3852,6 +3856,10 @@ declare module "assemblyscript/src/program" {
3852
3856
parent : Class ,
3853
3857
/** Concrete type. */
3854
3858
type : Type ) ;
3859
+ /** Gets the internal name of the respective getter function. */
3860
+ get internalGetterName ( ) : string ;
3861
+ /** Gets the internal name of the respective setter function. */
3862
+ get internalSetterName ( ) : string ;
3855
3863
}
3856
3864
/** A property comprised of a getter and a setter function. */
3857
3865
export class PropertyPrototype extends DeclaredElement {
@@ -4019,7 +4027,7 @@ declare module "assemblyscript/src/compiler" {
4019
4027
import { DiagnosticEmitter } from "assemblyscript/src/diagnostics" ;
4020
4028
import { Module , MemorySegment , ExpressionRef , NativeType , GlobalRef } from "assemblyscript/src/module" ;
4021
4029
import { Feature , Target } from "assemblyscript/src/common" ;
4022
- import { Program , Class , Element , Enum , Function , Global , VariableLikeElement , File } from "assemblyscript/src/program" ;
4030
+ import { Program , Class , Element , Enum , Field , Function , Global , Property , VariableLikeElement , File } from "assemblyscript/src/program" ;
4023
4031
import { Flow } from "assemblyscript/src/flow" ;
4024
4032
import { Resolver } from "assemblyscript/src/resolver" ;
4025
4033
import { Node , Range , Statement , Expression } from "assemblyscript/src/ast" ;
@@ -4154,10 +4162,6 @@ declare module "assemblyscript/src/compiler" {
4154
4162
private ensureModuleExports ;
4155
4163
/** Applies the respective module export(s) for the specified element. */
4156
4164
private ensureModuleExport ;
4157
- /** Makes an exported function to get the value of an instance field. */
4158
- private makeExportedFieldGetter ;
4159
- /** Makes an exported function to set the value of an instance field. */
4160
- private makeExportedFieldSetter ;
4161
4165
/** Compiles any element. */
4162
4166
compileElement ( element : Element , compileMembers ?: boolean ) : void ;
4163
4167
/** Compiles a file's exports. */
@@ -4180,6 +4184,17 @@ declare module "assemblyscript/src/compiler" {
4180
4184
private compileFunctionBody ;
4181
4185
/** Compiles a priorly resolved class. */
4182
4186
compileClass ( instance : Class ) : boolean ;
4187
+ /** Compiles an instance field to a getter and a setter. */
4188
+ compileField ( instance : Field ) : boolean ;
4189
+ /** Compiles the getter of the specified instance field. */
4190
+ compileFieldGetter ( instance : Field ) : boolean ;
4191
+ /** Compiles the setter of the specified instance field. */
4192
+ compileFieldSetter ( instance : Field ) : boolean ;
4193
+ /** Compiles a property to a getter and potentially a setter. */
4194
+ compileProperty ( instance : Property ) : boolean ;
4195
+ compilePropertyGetter ( instance : Property ) : boolean ;
4196
+ /** Compiles the setter of the specified property. */
4197
+ compilePropertySetter ( instance : Property ) : boolean ;
4183
4198
/** Adds a static memory segment with the specified data. */
4184
4199
addMemorySegment ( buffer : Uint8Array , alignment ?: number ) : MemorySegment ;
4185
4200
/** Ensures that a string exists in static memory and returns a pointer to it. Deduplicates. */
0 commit comments