mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
worker: unroll file extension regexp
Refs: https://github.com/nodejs/node/pull/31662#discussion_r377016190 PR-URL: https://github.com/nodejs/node/pull/31779 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
1 parent
eb2dce8342
commit
f87ac90849
1 file changed
+1
-1
@@ -104,7 +104,7 @@ class Worker extends EventEmitter {
|
||||
filename = path.resolve(filename);
|
||||
|
||||
const ext = path.extname(filename);
|
||||
if (!/^\.[cm]?js$/.test(ext)) {
|
||||
if (ext !== '.js' && ext !== '.mjs' && ext !== '.cjs') {
|
||||
throw new ERR_WORKER_UNSUPPORTED_EXTENSION(ext);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user