| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9270684 commit 16271d2
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2502,12 +2502,6 @@ nor a relative path starting with `./` or `../`. | |||
| 2502 | 2502 | ||
| 2503 | 2503 | All attempts at serializing an uncaught exception from a worker thread failed. | |
| 2504 | 2504 | ||
| 2505 | - <a id="ERR_WORKER_UNSUPPORTED_EXTENSION"></a> | ||
| 2506 | - ### `ERR_WORKER_UNSUPPORTED_EXTENSION` | ||
| 2507 | - | ||
| 2508 | - The pathname used for the main script of a worker has an | ||
| 2509 | - unknown file extension. | ||
| 2510 | - | ||
| 2511 | 2505 | <a id="ERR_WORKER_UNSUPPORTED_OPERATION"></a> | |
| 2512 | 2506 | ### `ERR_WORKER_UNSUPPORTED_OPERATION` | |
| 2513 | 2507 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1617,9 +1617,6 @@ E('ERR_WORKER_PATH', (filename) => | |||
| 1617 | 1617 | TypeError); | |
| 1618 | 1618 | E('ERR_WORKER_UNSERIALIZABLE_ERROR', | |
| 1619 | 1619 | 'Serializing an uncaught exception failed', Error); | |
| 1620 | - E('ERR_WORKER_UNSUPPORTED_EXTENSION', | ||
| 1621 | - 'The worker script extension must be ".js", ".mjs", or ".cjs". Received "%s"', | ||
| 1622 | - TypeError); | ||
| 1623 | 1620 | E('ERR_WORKER_UNSUPPORTED_OPERATION', | |
| 1624 | 1621 | '%s is not supported in workers', TypeError); | |
| 1625 | 1622 | E('ERR_ZLIB_INITIALIZATION_FAILED', 'Initialization failed', Error); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,6 @@ const { | |||
| 35 | 35 | ERR_WORKER_NOT_RUNNING, | |
| 36 | 36 | ERR_WORKER_PATH, | |
| 37 | 37 | ERR_WORKER_UNSERIALIZABLE_ERROR, | |
| 38 | - ERR_WORKER_UNSUPPORTED_EXTENSION, | ||
| 39 | 38 | ERR_WORKER_INVALID_EXEC_ARGV, | |
| 40 | 39 | ERR_INVALID_ARG_TYPE, | |
| 41 | 40 | ERR_INVALID_ARG_VALUE, | |
@@ -167,11 +166,6 @@ class Worker extends EventEmitter { | |||
| 167 | 166 | } else { | |
| 168 | 167 | throw new ERR_WORKER_PATH(filename); | |
| 169 | 168 | } | |
| 170 | - | ||
| 171 | - const ext = path.extname(filename); | ||
| 172 | - if (ext !== '.js' && ext !== '.mjs' && ext !== '.cjs') { | ||
| 173 | - throw new ERR_WORKER_UNSUPPORTED_EXTENSION(ext); | ||
| 174 | - } | ||
| 175 | 169 | } | |
| 176 | 170 | ||
| 177 | 171 | let env; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,17 +5,6 @@ const path = require('path'); | |||
| 5 | 5 | const assert = require('assert'); | |
| 6 | 6 | const { Worker } = require('worker_threads'); | |
| 7 | 7 | ||
| 8 | - { | ||
| 9 | - const expectedErr = { | ||
| 10 | - code: 'ERR_WORKER_UNSUPPORTED_EXTENSION', | ||
| 11 | - name: 'TypeError' | ||
| 12 | - }; | ||
| 13 | - assert.throws(() => { new Worker('/b'); }, expectedErr); | ||
| 14 | - assert.throws(() => { new Worker('/c.wasm'); }, expectedErr); | ||
| 15 | - assert.throws(() => { new Worker('/d.txt'); }, expectedErr); | ||
| 16 | - assert.throws(() => { new Worker(new URL('file:///C:/e.wasm')); }, expectedErr); | ||
| 17 | - } | ||
| 18 | - | ||
| 19 | 8 | { | |
| 20 | 9 | const expectedErr = { | |
| 21 | 10 | code: 'ERR_WORKER_PATH', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments