(name: string)
| 45 | } |
| 46 | |
| 47 | assertNameNotDuplicate(name: string) { |
| 48 | for (const item of this.declares.values()) { |
| 49 | if (item === name) { |
| 50 | throw new Error(`const ${name} declare duplicate`); |
| 51 | } |
| 52 | } |
| 53 | for (const item of this.varDeclares.keys()) { |
| 54 | if (item === name) { |
| 55 | throw new Error(`let ${name} declare duplicate`); |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | declare(prefix: string, stmt: string) { |
| 61 | return this.addDeclar(stmt, this.uniqueName(prefix)); |
no test coverage detected