()
| 174 | |
| 175 | // Check the JavaScript engine deals with exceptions correctly |
| 176 | async function checkExecution() { |
| 177 | await (async () => { |
| 178 | const m = new SourceTextModule('import { nonexistent } from "module";'); |
| 179 | |
| 180 | // There is no code for this exception since it is thrown by the JavaScript |
| 181 | // engine. |
| 182 | await assert.rejects(() => { |
| 183 | return m.link(common.mustCall(() => new SourceTextModule(''))); |
| 184 | }, SyntaxError); |
| 185 | })(); |
| 186 | |
| 187 | await (async () => { |
| 188 | const m = new SourceTextModule('throw new Error();'); |
| 189 | await m.link(common.mustNotCall()); |
| 190 | try { |
| 191 | await m.evaluate(); |
| 192 | } catch (err) { |
| 193 | assert.strictEqual(m.error, err); |
| 194 | assert.strictEqual(m.status, 'errored'); |
| 195 | return; |
| 196 | } |
| 197 | assert.fail('Missing expected exception'); |
| 198 | })(); |
| 199 | } |
| 200 | |
| 201 | // Check for error thrown when breakOnSigint is not a boolean for evaluate() |
| 202 | async function checkInvalidOptionForEvaluate() { |
no test coverage detected
searching dependent graphs…