storeObjectRef.ts 549 B

1234567891011121314151617181920212223242526272829
  1. import { StoreObject } from './storeObject';
  2. import { Location } from '../../memory/location';
  3. import { IStoreValue } from './istore_value';
  4. export class StoreObjectRef extends StoreObject {
  5. private refObj: String;
  6. /**
  7. *
  8. * @param {StoreObject} stoValue
  9. */
  10. constructor (stoValue: IStoreValue, loc_address: number) {
  11. super(stoValue.type, loc_address, false);
  12. this.refObj = stoValue.id!;
  13. }
  14. get isRef () {
  15. return true;
  16. }
  17. getRefObj (): String {
  18. return this.refObj;
  19. }
  20. destroy () {
  21. return false;
  22. }
  23. }