node
node copied to clipboard
build: ignore `v8_enable|disble_object_print` CLI option handling
The final gyp file output is correct, this commit omits a unnecessary option validation. The configure_v8
function will switch the option based on output.
Even before this patch if --v8-disable-object-print
is provided, the v8_enable_object_print
is overwriten to 0
This patch will emit a warning instead of an exception. Just explains the final value of v8_enable_object_print
$ ./configure \
--v8-enable-object-print --v8-disable-object-print --verbose | \
grep v8_enable_object_print
can be specified at a time. The v8_enable_object_print is set to 0
'v8_enable_object_print': 0,
Fixes: https://github.com/nodejs/node/issues/51729
Just converting the exception to a warning is still going to be confusing when people only pass --v8-disable-object-print
. I would propose instead defaulting both flags to False
and then add a check where if both values are False
(meaning no flags were passed) then set v8_enable_object_print
to True
and keep the existing check that raises the exception if both values are True
.
Doing it this way should ensure that if we have the following command lines then we get the expected results:
- (nothing passed)
-
v8_enable_object_print
:True
-
v8_disable_object_print
:False
-
-
--v8-enable-object-print
:-
v8_enable_object_print
:True
-
v8_disable_object_print
:False
-
-
--v8-disable-object-print
:-
v8_enable_object_print
:False
-
v8_disable_object_print
:True
-
-
--v8-enable-object-print --v8-disable-object-print
:- Exception raised as expected
@mscdex PTAL :)