()
| 2145 | // https://tc39.github.io/ecma262/#sec-do-while-statement |
| 2146 | |
| 2147 | parseDoWhileStatement(): Node.DoWhileStatement { |
| 2148 | const node = this.createNode(); |
| 2149 | this.expectKeyword('do'); |
| 2150 | |
| 2151 | const previousInIteration = this.context.inIteration; |
| 2152 | this.context.inIteration = true; |
| 2153 | const body = this.parseStatement(); |
| 2154 | this.context.inIteration = previousInIteration; |
| 2155 | |
| 2156 | this.expectKeyword('while'); |
| 2157 | this.expect('('); |
| 2158 | const test = this.parseExpression(); |
| 2159 | |
| 2160 | if (!this.match(')') && this.config.tolerant) { |
| 2161 | this.tolerateUnexpectedToken(this.nextToken()); |
| 2162 | } else { |
| 2163 | this.expect(')'); |
| 2164 | if (this.match(';')) { |
| 2165 | this.nextToken(); |
| 2166 | } |
| 2167 | } |
| 2168 | |
| 2169 | return this.finalize(node, new Node.DoWhileStatement(body, test)); |
| 2170 | } |
| 2171 | |
| 2172 | // https://tc39.github.io/ecma262/#sec-while-statement |
| 2173 |
no test coverage detected