@awayfl/avm2
Version:
Virtual machine for executing AS3 code
35 lines (34 loc) • 1.21 kB
JavaScript
import { getTRAITName } from './TRAIT';
var TraitInfo = /** @class */ (function () {
function TraitInfo(abc, kind, multiname) {
this.abc = abc;
this.kind = kind;
this.multiname = multiname;
}
TraitInfo.prototype.toString = function () {
return getTRAITName(this.kind) + ' ' + this.multiname;
};
TraitInfo.prototype.isConst = function () {
return this.kind === 6 /* TRAIT.Const */;
};
TraitInfo.prototype.isSlot = function () {
return this.kind === 0 /* TRAIT.Slot */;
};
TraitInfo.prototype.isMethod = function () {
return this.kind === 1 /* TRAIT.Method */;
};
TraitInfo.prototype.isGetter = function () {
return this.kind === 2 /* TRAIT.Getter */;
};
TraitInfo.prototype.isSetter = function () {
return this.kind === 3 /* TRAIT.Setter */;
};
TraitInfo.prototype.isAccessor = function () {
return this.kind === 2 /* TRAIT.Getter */ || this.kind === 3 /* TRAIT.Setter */;
};
TraitInfo.prototype.isMethodOrAccessor = function () {
return this.isAccessor() || this.kind === 1 /* TRAIT.Method */;
};
return TraitInfo;
}());
export { TraitInfo };