(this: Parser)
| 3191 | |
| 3192 | // https://github.com/tc39/proposal-js-module-blocks |
| 3193 | parseModuleExpression(this: Parser): N.ModuleExpression { |
| 3194 | this.expectPlugin("moduleBlocks"); |
| 3195 | const node = this.startNode<N.ModuleExpression>(); |
| 3196 | this.next(); // eat "module" |
| 3197 | if (!this.match(tt.braceL)) { |
| 3198 | this.unexpected(null, tt.braceL); |
| 3199 | } |
| 3200 | // start program node immediately after `{` |
| 3201 | const program = this.startNodeAt<N.Program>(this.state.endLoc); |
| 3202 | this.next(); // eat `{` |
| 3203 | |
| 3204 | const revertScopes = this.initializeScopes(/** inModule */ true); |
| 3205 | this.enterInitialScopes(); |
| 3206 | |
| 3207 | try { |
| 3208 | node.body = this.parseProgram(program, tt.braceR, "module"); |
| 3209 | } finally { |
| 3210 | revertScopes(); |
| 3211 | } |
| 3212 | return this.finishNode<N.ModuleExpression>(node, "ModuleExpression"); |
| 3213 | } |
| 3214 | |
| 3215 | parseVoidPattern( |
| 3216 | this: Parser, |
nothing calls this directly
no test coverage detected