@@ -2835,7 +2835,7 @@ declare module "assemblyscript/src/resolver" {
2835
2835
* @license Apache-2.0
2836
2836
*/
2837
2837
import { DiagnosticEmitter } from "assemblyscript/src/diagnostics" ;
2838
- import { Program , Element , Class , ClassPrototype , Function , FunctionPrototype } from "assemblyscript/src/program" ;
2838
+ import { Program , Element , Class , ClassPrototype , Function , FunctionPrototype , Property , PropertyPrototype } from "assemblyscript/src/program" ;
2839
2839
import { Flow } from "assemblyscript/src/flow" ;
2840
2840
import { TypeNode , TypeName , TypeParameterNode , Node , IdentifierExpression , CallExpression , Expression } from "assemblyscript/src/ast" ;
2841
2841
import { Type } from "assemblyscript/src/types" ;
@@ -3058,6 +3058,12 @@ declare module "assemblyscript/src/resolver" {
3058
3058
reportNode : Node ,
3059
3059
/** How to proceed with eventual diagnostics. */
3060
3060
reportMode ?: ReportMode ) : Class | null ;
3061
+ /** Resolves a property prototype. */
3062
+ resolveProperty (
3063
+ /** The prototype of the property. */
3064
+ prototype : PropertyPrototype ,
3065
+ /** How to proceed with eventual diagnostics. */
3066
+ reportMode ?: ReportMode ) : Property | null ;
3061
3067
}
3062
3068
}
3063
3069
declare module "assemblyscript/src/parser" {
@@ -4018,15 +4024,23 @@ declare module "assemblyscript/src/program" {
4018
4024
getterPrototype : FunctionPrototype | null ;
4019
4025
/** Setter prototype. */
4020
4026
setterPrototype : FunctionPrototype | null ;
4027
+ /** Property instance, if resolved. */
4028
+ instance : Property | null ;
4029
+ /** Clones of this prototype that are bound to specific classes. */
4030
+ private boundPrototypes ;
4021
4031
/** Constructs a new property prototype. */
4022
4032
constructor (
4023
4033
/** Simple name. */
4024
4034
name : string ,
4025
- /** Parent class. */
4026
- parent : ClassPrototype ,
4035
+ /** Parent element. Either a class prototype or instance . */
4036
+ parent : Element ,
4027
4037
/** Declaration of the getter or setter introducing the property. */
4028
4038
firstDeclaration : FunctionDeclaration ) ;
4029
4039
lookup ( name : string ) : Element | null ;
4040
+ /** Tests if this prototype is bound to a class. */
4041
+ get isBound ( ) : boolean ;
4042
+ /** Creates a clone of this prototype that is bound to a concrete class instead. */
4043
+ toBound ( classInstance : Class ) : PropertyPrototype ;
4030
4044
}
4031
4045
/** A resolved property. */
4032
4046
export class Property extends VariableLikeElement {
@@ -5199,7 +5213,6 @@ declare module "assemblyscript/src/definitions" {
5199
5213
visitElement ( name : string , element : Element ) : void ;
5200
5214
private visitFunctionInstances ;
5201
5215
private visitClassInstances ;
5202
- private visitPropertyInstances ;
5203
5216
abstract visitGlobal ( name : string , element : Global ) : void ;
5204
5217
abstract visitEnum ( name : string , element : Enum ) : void ;
5205
5218
abstract visitFunction ( name : string , element : Function ) : void ;
0 commit comments