mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
lib: refactor to use validateBoolean
PR-URL: https://github.com/nodejs/node/pull/36983 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
96f3977ded
commit
cb5668be99
5 changed files with 11 additions and 20 deletions
|
@ -90,10 +90,7 @@ class Script extends ContextifyScript {
|
|||
cachedData
|
||||
);
|
||||
}
|
||||
if (typeof produceCachedData !== 'boolean') {
|
||||
throw new ERR_INVALID_ARG_TYPE('options.produceCachedData', 'boolean',
|
||||
produceCachedData);
|
||||
}
|
||||
validateBoolean(produceCachedData, 'options.produceCachedData');
|
||||
|
||||
// Calling `ReThrow()` on a native TryCatch does not generate a new
|
||||
// abort-on-uncaught-exception check. A dummy try/catch in JS land
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue