UNPKG

@awayfl/avm2

Version:

Virtual machine for executing AS3 code

27 lines (26 loc) 1.08 kB
import { __extends } from "tslib"; import { TraitInfo } from './TraitInfo'; import { typeDefaultValues } from './typeDefaultValues'; var SlotTraitInfo = /** @class */ (function (_super) { __extends(SlotTraitInfo, _super); function SlotTraitInfo(abc, kind, multiname, slot, typeName, defaultValueKind, defaultValueIndex) { var _this = _super.call(this, abc, kind, multiname) || this; _this.slot = slot; _this.typeName = typeName; _this.defaultValueKind = defaultValueKind; _this.defaultValueIndex = defaultValueIndex; return _this; } SlotTraitInfo.prototype.getDefaultValue = function () { if (this.defaultValueKind === -1) { if (this.typeName === null) { return undefined; } var value = typeDefaultValues[this.typeName.getMangledName()]; return value === undefined ? null : value; } return this.abc.getConstant(this.defaultValueKind, this.defaultValueIndex); }; return SlotTraitInfo; }(TraitInfo)); export { SlotTraitInfo };