| 35 | }; |
| 36 | |
| 37 | class VariableReference implements Reference { |
| 38 | constructor(private name: string, private scope: Scope) { |
| 39 | this.type = 'reference'; |
| 40 | } |
| 41 | |
| 42 | type: 'reference'; |
| 43 | |
| 44 | get(): Value { |
| 45 | return this.scope.get(this.name); |
| 46 | } |
| 47 | |
| 48 | set(value: Value): void { |
| 49 | this.scope.assign(this.name, value); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | class IndexReference implements Reference { |
| 54 | constructor(private target: Value[], private index: number) { |
nothing calls this directly
no outgoing calls
no test coverage detected