* Get the value of the variable, considered as a string * @return The string stored in the variable
()
| 588 | * @return The string stored in the variable |
| 589 | */ |
| 590 | getAsString(): string { |
| 591 | if (this._type !== 'string') { |
| 592 | if (this._type === 'number') return this._value.toString(); |
| 593 | else if (this._type === 'boolean') return this._bool ? 'true' : 'false'; |
| 594 | else if (this._type === 'structure') return '[Structure]'; |
| 595 | else if (this._type === 'array') return '[Array]'; |
| 596 | else return ''; |
| 597 | } |
| 598 | |
| 599 | return this._str; |
| 600 | } |
| 601 | |
| 602 | /** |
| 603 | * Change the value of the variable, considered as a string |
no test coverage detected