node/test/js-native-api
Joyee Cheung 17ab5ae570 test: fix unreliable assumption in js-native-api/test_cannot_run_js
Previously the test assumes that when the queued finalizer is run,
it must be run at a point where env->can_call_into_js() is false
(typically, during Environment shutdown), which is not certain.
If GC kicks in early and the second pass finalizer is queued before
the event loop runs the check callbacks, the finalizer would then
be called in check callbacks (via native immediates), where
the finalizer can still call into JS. Essentially, addons can't
make assumptions about where the queued finalizer would be called.
This patch updates the assertions in the test to account for that.

PR-URL: https://github.com/nodejs/node/pull/51898
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-03-01 09:20:49 +01:00
..
2_function_arguments
3_callbacks
4_object_factory
5_function_factory
6_object_wrap
7_factory_wrap
8_passing_wrapped
test_array
test_bigint
test_cannot_run_js test: fix unreliable assumption in js-native-api/test_cannot_run_js 2024-03-01 09:20:49 +01:00
test_constructor
test_conversions
test_dataview
test_date
test_error
test_exception
test_finalizer node-api: segregate nogc APIs from rest via type system 2024-01-02 15:05:23 -03:00
test_function
test_general
test_handle_scope
test_instance_data
test_new_target
test_number
test_object
test_promise
test_properties
test_reference
test_reference_double_free
test_string node-api: move NAPI_EXPERIMENTAL definition to gyp file 2024-02-15 12:02:31 +01:00
test_symbol
test_typedarray
.gitignore
common-inl.h
common.h node-api: segregate nogc APIs from rest via type system 2024-01-02 15:05:23 -03:00
entry_point.h
testcfg.py