(source, offset, region)
| 155 | } |
| 156 | |
| 157 | function parseAndCollect(source, offset, region) { |
| 158 | var result; |
| 159 | try { |
| 160 | result = _hyperscript.parse(source); |
| 161 | } catch (e) { |
| 162 | // Tokenizer can throw on unterminated strings, etc. |
| 163 | errors.push(formatError(filePath, content, { |
| 164 | message: e.message, |
| 165 | token: { start: 0, value: '', line: 1, column: 0 }, |
| 166 | }, offset, region)); |
| 167 | return; |
| 168 | } |
| 169 | if (result.errors?.length) { |
| 170 | for (const err of result.errors) { |
| 171 | errors.push(formatError(filePath, content, err, offset, region)); |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | return errors; |
| 176 | } |
| 177 |
no test coverage detected