* Push the declaration to this.declarations with some checks.
(...declarations: syntax.DeclarationStatement[])
| 175 | * Push the declaration to this.declarations with some checks. |
| 176 | */ |
| 177 | private pushDeclaration(...declarations: syntax.DeclarationStatement[]) { |
| 178 | for (const decl of declarations) { |
| 179 | if (decl instanceof syntax.VariableStatement) { |
| 180 | if (decl.type.hasObject() && decl.declarationList.declarations.some(d => d.initializer)) |
| 181 | throw new Error('Can not initialize objects in top-level variable declarations'); |
| 182 | } |
| 183 | } |
| 184 | this.declarations.statements.push(...declarations); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * Print declarations for all the function and class declarations. |
no test coverage detected