| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dab3d71 commit 76c2f4f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,15 +3,9 @@ const common = require('../common'); | |||
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const { Worker } = require('worker_threads'); | |
| 5 | 5 | ||
| 6 | - // Do not use isMainThread so that this test itself can be run inside a Worker. | ||
| 7 | - if (!process.env.HAS_STARTED_WORKER) { | ||
| 8 | - process.env.HAS_STARTED_WORKER = 1; | ||
| 9 | - const w = new Worker('abc)', { eval: true }); | ||
| 10 | - w.on('message', common.mustNotCall()); | ||
| 11 | - w.on('error', common.mustCall((err) => { | ||
| 12 | - assert.strictEqual(err.constructor, SyntaxError); | ||
| 13 | - assert(/SyntaxError/.test(err)); | ||
| 14 | - })); | ||
| 15 | - } else { | ||
| 16 | - throw new Error('foo'); | ||
| 17 | - } | ||
| 6 | + const w = new Worker('abc)', { eval: true }); | ||
| 7 | + w.on('message', common.mustNotCall()); | ||
| 8 | + w.on('error', common.mustCall((err) => { | ||
| 9 | + assert.strictEqual(err.constructor, SyntaxError); | ||
| 10 | + assert(/SyntaxError/.test(err)); | ||
| 11 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments