koffi 0.9.0 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +2 -36
- package/package.json +8 -4
- package/vendor/dragonbox/CMakeLists.txt +123 -0
- package/vendor/dragonbox/LICENSE-Apache2-LLVM +218 -0
- package/vendor/dragonbox/LICENSE-Boost +23 -0
- package/vendor/dragonbox/README.md +277 -0
- package/vendor/dragonbox/cmake/dragonboxConfig.cmake +1 -0
- package/vendor/dragonbox/include/dragonbox/dragonbox.h +2670 -0
- package/vendor/dragonbox/include/dragonbox/dragonbox_to_chars.h +108 -0
- package/vendor/dragonbox/other_files/Dragonbox.pdf +0 -0
- package/vendor/dragonbox/other_files/Dragonbox_old.pdf +0 -0
- package/vendor/dragonbox/other_files/milo_benchmark.png +0 -0
- package/vendor/dragonbox/other_files/unknown_win64_vc2019.html +540 -0
- package/vendor/dragonbox/other_files/unknown_win64_vc2019_randomdigit_time.png +0 -0
- package/vendor/dragonbox/source/dragonbox_to_chars.cpp +303 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/CMakeLists.txt +24 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.cpp +238 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/fp_to_chars.h +95 -0
- package/vendor/dragonbox/subproject/3rdparty/grisu_exact/grisu_exact.h +2666 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/CMakeLists.txt +16 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/common.h +114 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s.c +509 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_full_table.h +367 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/d2s_intrinsics.h +357 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/digit_table.h +35 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s.c +345 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_full_table.h +55 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/f2s_intrinsics.h +128 -0
- package/vendor/dragonbox/subproject/3rdparty/ryu/ryu/ryu.h +46 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/CMakeLists.txt +22 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.cc +699 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_32.h +31 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.cc +1354 -0
- package/vendor/dragonbox/subproject/3rdparty/schubfach/schubfach_64.h +31 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/example_shaded_plots.m +68 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/license.txt +25 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution.m +92 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_distribution_prctile.m +121 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_histogram_shaded.m +99 -0
- package/vendor/dragonbox/subproject/3rdparty/shaded_plots/plot_shaded.m +93 -0
- package/vendor/dragonbox/subproject/benchmark/CMakeLists.txt +65 -0
- package/vendor/dragonbox/subproject/benchmark/include/benchmark.h +40 -0
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_benchmarks.m +22 -0
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_digit_benchmark.m +78 -0
- package/vendor/dragonbox/subproject/benchmark/matlab/plot_uniform_benchmark.m +95 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/digits_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary32_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_clang.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/results/uniform_benchmark_binary64_msvc.png +0 -0
- package/vendor/dragonbox/subproject/benchmark/source/benchmark.cpp +238 -0
- package/vendor/dragonbox/subproject/benchmark/source/dragonbox.cpp +30 -0
- package/vendor/dragonbox/subproject/benchmark/source/grisu_exact.cpp +36 -0
- package/vendor/dragonbox/subproject/benchmark/source/ryu.cpp +27 -0
- package/vendor/dragonbox/subproject/benchmark/source/schubfach.cpp +31 -0
- package/vendor/dragonbox/subproject/common/CMakeLists.txt +42 -0
- package/vendor/dragonbox/subproject/common/include/best_rational_approx.h +97 -0
- package/vendor/dragonbox/subproject/common/include/big_uint.h +218 -0
- package/vendor/dragonbox/subproject/common/include/continued_fractions.h +174 -0
- package/vendor/dragonbox/subproject/common/include/good_rational_approx.h +267 -0
- package/vendor/dragonbox/subproject/common/include/random_float.h +182 -0
- package/vendor/dragonbox/subproject/common/include/rational_continued_fractions.h +57 -0
- package/vendor/dragonbox/subproject/common/source/big_uint.cpp +602 -0
- package/vendor/dragonbox/subproject/meta/CMakeLists.txt +41 -0
- package/vendor/dragonbox/subproject/meta/results/binary32_generated_cache.txt +82 -0
- package/vendor/dragonbox/subproject/meta/results/binary64_compressed_cache_error_table.txt +10 -0
- package/vendor/dragonbox/subproject/meta/results/binary64_generated_cache.txt +623 -0
- package/vendor/dragonbox/subproject/meta/source/generate_cache.cpp +126 -0
- package/vendor/dragonbox/subproject/meta/source/live_test.cpp +81 -0
- package/vendor/dragonbox/subproject/meta/source/perf_test.cpp +104 -0
- package/vendor/dragonbox/subproject/meta/source/sandbox.cpp +20 -0
- package/vendor/dragonbox/subproject/test/CMakeLists.txt +70 -0
- package/vendor/dragonbox/subproject/test/results/binary32.csv +255 -0
- package/vendor/dragonbox/subproject/test/results/binary64.csv +2047 -0
- package/vendor/dragonbox/subproject/test/results/plot_required_bits.m +18 -0
- package/vendor/dragonbox/subproject/test/source/test_all_shorter_interval_cases.cpp +88 -0
- package/vendor/dragonbox/subproject/test/source/uniform_random_test.cpp +95 -0
- package/vendor/dragonbox/subproject/test/source/verify_cache_precision.cpp +338 -0
- package/vendor/dragonbox/subproject/test/source/verify_compressed_cache.cpp +154 -0
- package/vendor/dragonbox/subproject/test/source/verify_fast_multiplication.cpp +168 -0
- package/vendor/dragonbox/subproject/test/source/verify_log_computation.cpp +251 -0
- package/vendor/dragonbox/subproject/test/source/verify_magic_division.cpp +113 -0
- package/vendor/libcc/libcc.cc +7651 -0
- package/vendor/libcc/libcc.hh +4312 -0
- package/vendor/node-addon-api/CHANGELOG.md +859 -0
- package/vendor/node-addon-api/CODE_OF_CONDUCT.md +4 -0
- package/vendor/node-addon-api/CONTRIBUTING.md +93 -0
- package/vendor/node-addon-api/LICENSE.md +13 -0
- package/vendor/node-addon-api/README.md +293 -0
- package/vendor/node-addon-api/appveyor.yml +37 -0
- package/vendor/node-addon-api/benchmark/README.md +47 -0
- package/vendor/node-addon-api/benchmark/binding.gyp +25 -0
- package/vendor/node-addon-api/benchmark/function_args.cc +217 -0
- package/vendor/node-addon-api/benchmark/function_args.js +60 -0
- package/vendor/node-addon-api/benchmark/index.js +34 -0
- package/vendor/node-addon-api/benchmark/property_descriptor.cc +91 -0
- package/vendor/node-addon-api/benchmark/property_descriptor.js +37 -0
- package/vendor/node-addon-api/common.gypi +21 -0
- package/vendor/node-addon-api/doc/addon.md +163 -0
- package/vendor/node-addon-api/doc/array.md +81 -0
- package/vendor/node-addon-api/doc/array_buffer.md +155 -0
- package/vendor/node-addon-api/doc/async_context.md +86 -0
- package/vendor/node-addon-api/doc/async_operations.md +31 -0
- package/vendor/node-addon-api/doc/async_worker.md +427 -0
- package/vendor/node-addon-api/doc/async_worker_variants.md +557 -0
- package/vendor/node-addon-api/doc/bigint.md +97 -0
- package/vendor/node-addon-api/doc/boolean.md +68 -0
- package/vendor/node-addon-api/doc/buffer.md +150 -0
- package/vendor/node-addon-api/doc/callback_scope.md +54 -0
- package/vendor/node-addon-api/doc/callbackinfo.md +97 -0
- package/vendor/node-addon-api/doc/checker-tool.md +32 -0
- package/vendor/node-addon-api/doc/class_property_descriptor.md +115 -0
- package/vendor/node-addon-api/doc/cmake-js.md +68 -0
- package/vendor/node-addon-api/doc/conversion-tool.md +28 -0
- package/vendor/node-addon-api/doc/creating_a_release.md +62 -0
- package/vendor/node-addon-api/doc/dataview.md +248 -0
- package/vendor/node-addon-api/doc/date.md +68 -0
- package/vendor/node-addon-api/doc/env.md +196 -0
- package/vendor/node-addon-api/doc/error.md +120 -0
- package/vendor/node-addon-api/doc/error_handling.md +254 -0
- package/vendor/node-addon-api/doc/escapable_handle_scope.md +80 -0
- package/vendor/node-addon-api/doc/external.md +63 -0
- package/vendor/node-addon-api/doc/function.md +402 -0
- package/vendor/node-addon-api/doc/function_reference.md +238 -0
- package/vendor/node-addon-api/doc/generator.md +13 -0
- package/vendor/node-addon-api/doc/handle_scope.md +63 -0
- package/vendor/node-addon-api/doc/hierarchy.md +91 -0
- package/vendor/node-addon-api/doc/instance_wrap.md +408 -0
- package/vendor/node-addon-api/doc/maybe.md +76 -0
- package/vendor/node-addon-api/doc/memory_management.md +27 -0
- package/vendor/node-addon-api/doc/name.md +29 -0
- package/vendor/node-addon-api/doc/node-gyp.md +82 -0
- package/vendor/node-addon-api/doc/number.md +163 -0
- package/vendor/node-addon-api/doc/object.md +432 -0
- package/vendor/node-addon-api/doc/object_lifetime_management.md +83 -0
- package/vendor/node-addon-api/doc/object_reference.md +117 -0
- package/vendor/node-addon-api/doc/object_wrap.md +561 -0
- package/vendor/node-addon-api/doc/prebuild_tools.md +16 -0
- package/vendor/node-addon-api/doc/promises.md +79 -0
- package/vendor/node-addon-api/doc/property_descriptor.md +286 -0
- package/vendor/node-addon-api/doc/propertylvalue.md +50 -0
- package/vendor/node-addon-api/doc/range_error.md +59 -0
- package/vendor/node-addon-api/doc/reference.md +113 -0
- package/vendor/node-addon-api/doc/setup.md +110 -0
- package/vendor/node-addon-api/doc/string.md +93 -0
- package/vendor/node-addon-api/doc/symbol.md +61 -0
- package/vendor/node-addon-api/doc/threadsafe.md +121 -0
- package/vendor/node-addon-api/doc/threadsafe_function.md +290 -0
- package/vendor/node-addon-api/doc/type_error.md +59 -0
- package/vendor/node-addon-api/doc/typed_array.md +78 -0
- package/vendor/node-addon-api/doc/typed_array_of.md +137 -0
- package/vendor/node-addon-api/doc/typed_threadsafe_function.md +306 -0
- package/vendor/node-addon-api/doc/value.md +340 -0
- package/vendor/node-addon-api/doc/version_management.md +43 -0
- package/vendor/node-addon-api/except.gypi +25 -0
- package/vendor/node-addon-api/index.js +11 -0
- package/vendor/node-addon-api/napi-inl.deprecated.h +192 -0
- package/vendor/node-addon-api/napi-inl.h +6209 -0
- package/vendor/node-addon-api/napi.h +2983 -0
- package/vendor/node-addon-api/node_api.gyp +9 -0
- package/vendor/node-addon-api/noexcept.gypi +26 -0
- package/vendor/node-addon-api/nothing.c +0 -0
- package/vendor/node-addon-api/package-support.json +21 -0
- package/vendor/node-addon-api/package.json +399 -0
- package/vendor/node-addon-api/test/README.md +91 -0
- package/vendor/node-addon-api/test/addon.cc +36 -0
- package/vendor/node-addon-api/test/addon.js +11 -0
- package/vendor/node-addon-api/test/addon_build/index.js +49 -0
- package/vendor/node-addon-api/test/addon_build/tpl/addon.cc +17 -0
- package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +62 -0
- package/vendor/node-addon-api/test/addon_build/tpl/index.js +9 -0
- package/vendor/node-addon-api/test/addon_build/tpl/package.json +11 -0
- package/vendor/node-addon-api/test/addon_data.cc +99 -0
- package/vendor/node-addon-api/test/addon_data.js +46 -0
- package/vendor/node-addon-api/test/array_buffer.cc +243 -0
- package/vendor/node-addon-api/test/array_buffer.js +69 -0
- package/vendor/node-addon-api/test/async_context.cc +21 -0
- package/vendor/node-addon-api/test/async_context.js +86 -0
- package/vendor/node-addon-api/test/async_progress_queue_worker.cc +83 -0
- package/vendor/node-addon-api/test/async_progress_queue_worker.js +46 -0
- package/vendor/node-addon-api/test/async_progress_worker.cc +134 -0
- package/vendor/node-addon-api/test/async_progress_worker.js +61 -0
- package/vendor/node-addon-api/test/async_worker.cc +106 -0
- package/vendor/node-addon-api/test/async_worker.js +179 -0
- package/vendor/node-addon-api/test/async_worker_nocallback.js +13 -0
- package/vendor/node-addon-api/test/async_worker_persistent.cc +63 -0
- package/vendor/node-addon-api/test/async_worker_persistent.js +24 -0
- package/vendor/node-addon-api/test/basic_types/array.cc +40 -0
- package/vendor/node-addon-api/test/basic_types/array.js +35 -0
- package/vendor/node-addon-api/test/basic_types/boolean.cc +38 -0
- package/vendor/node-addon-api/test/basic_types/boolean.js +35 -0
- package/vendor/node-addon-api/test/basic_types/number.cc +99 -0
- package/vendor/node-addon-api/test/basic_types/number.js +114 -0
- package/vendor/node-addon-api/test/basic_types/value.cc +120 -0
- package/vendor/node-addon-api/test/basic_types/value.js +133 -0
- package/vendor/node-addon-api/test/bigint.cc +91 -0
- package/vendor/node-addon-api/test/bigint.js +53 -0
- package/vendor/node-addon-api/test/binding-swallowexcept.cc +12 -0
- package/vendor/node-addon-api/test/binding.cc +171 -0
- package/vendor/node-addon-api/test/binding.gyp +117 -0
- package/vendor/node-addon-api/test/buffer.cc +183 -0
- package/vendor/node-addon-api/test/buffer.js +69 -0
- package/vendor/node-addon-api/test/callbackscope.cc +22 -0
- package/vendor/node-addon-api/test/callbackscope.js +49 -0
- package/vendor/node-addon-api/test/common/index.js +113 -0
- package/vendor/node-addon-api/test/common/test_helper.h +61 -0
- package/vendor/node-addon-api/test/dataview/dataview.cc +48 -0
- package/vendor/node-addon-api/test/dataview/dataview.js +35 -0
- package/vendor/node-addon-api/test/dataview/dataview_read_write.cc +115 -0
- package/vendor/node-addon-api/test/dataview/dataview_read_write.js +90 -0
- package/vendor/node-addon-api/test/date.cc +44 -0
- package/vendor/node-addon-api/test/date.js +18 -0
- package/vendor/node-addon-api/test/env_cleanup.cc +88 -0
- package/vendor/node-addon-api/test/env_cleanup.js +56 -0
- package/vendor/node-addon-api/test/error.cc +287 -0
- package/vendor/node-addon-api/test/error.js +81 -0
- package/vendor/node-addon-api/test/error_handling_for_primitives.cc +13 -0
- package/vendor/node-addon-api/test/error_handling_for_primitives.js +29 -0
- package/vendor/node-addon-api/test/error_terminating_environment.js +94 -0
- package/vendor/node-addon-api/test/external.cc +81 -0
- package/vendor/node-addon-api/test/external.js +88 -0
- package/vendor/node-addon-api/test/function.cc +295 -0
- package/vendor/node-addon-api/test/function.js +121 -0
- package/vendor/node-addon-api/test/function_reference.cc +202 -0
- package/vendor/node-addon-api/test/function_reference.js +157 -0
- package/vendor/node-addon-api/test/globalObject/global_object.cc +61 -0
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +31 -0
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.js +61 -0
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +40 -0
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.js +57 -0
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +28 -0
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.js +48 -0
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +31 -0
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.js +58 -0
- package/vendor/node-addon-api/test/handlescope.cc +60 -0
- package/vendor/node-addon-api/test/handlescope.js +14 -0
- package/vendor/node-addon-api/test/index.js +136 -0
- package/vendor/node-addon-api/test/maybe/check.cc +23 -0
- package/vendor/node-addon-api/test/maybe/index.js +38 -0
- package/vendor/node-addon-api/test/memory_management.cc +17 -0
- package/vendor/node-addon-api/test/memory_management.js +9 -0
- package/vendor/node-addon-api/test/movable_callbacks.cc +23 -0
- package/vendor/node-addon-api/test/movable_callbacks.js +21 -0
- package/vendor/node-addon-api/test/name.cc +108 -0
- package/vendor/node-addon-api/test/name.js +59 -0
- package/vendor/node-addon-api/test/napi_child.js +14 -0
- package/vendor/node-addon-api/test/object/delete_property.cc +38 -0
- package/vendor/node-addon-api/test/object/delete_property.js +41 -0
- package/vendor/node-addon-api/test/object/finalizer.cc +29 -0
- package/vendor/node-addon-api/test/object/finalizer.js +28 -0
- package/vendor/node-addon-api/test/object/get_property.cc +34 -0
- package/vendor/node-addon-api/test/object/get_property.js +40 -0
- package/vendor/node-addon-api/test/object/has_own_property.cc +34 -0
- package/vendor/node-addon-api/test/object/has_own_property.js +34 -0
- package/vendor/node-addon-api/test/object/has_property.cc +38 -0
- package/vendor/node-addon-api/test/object/has_property.js +37 -0
- package/vendor/node-addon-api/test/object/object.cc +348 -0
- package/vendor/node-addon-api/test/object/object.js +217 -0
- package/vendor/node-addon-api/test/object/object_deprecated.cc +66 -0
- package/vendor/node-addon-api/test/object/object_deprecated.js +47 -0
- package/vendor/node-addon-api/test/object/object_freeze_seal.cc +25 -0
- package/vendor/node-addon-api/test/object/object_freeze_seal.js +61 -0
- package/vendor/node-addon-api/test/object/set_property.cc +37 -0
- package/vendor/node-addon-api/test/object/set_property.js +29 -0
- package/vendor/node-addon-api/test/object/subscript_operator.cc +42 -0
- package/vendor/node-addon-api/test/object/subscript_operator.js +17 -0
- package/vendor/node-addon-api/test/object_reference.cc +219 -0
- package/vendor/node-addon-api/test/object_reference.js +259 -0
- package/vendor/node-addon-api/test/objectwrap.cc +268 -0
- package/vendor/node-addon-api/test/objectwrap.js +284 -0
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.cc +26 -0
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.js +18 -0
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.cc +30 -0
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.js +13 -0
- package/vendor/node-addon-api/test/objectwrap_removewrap.cc +45 -0
- package/vendor/node-addon-api/test/objectwrap_removewrap.js +40 -0
- package/vendor/node-addon-api/test/objectwrap_worker_thread.js +19 -0
- package/vendor/node-addon-api/test/promise.cc +29 -0
- package/vendor/node-addon-api/test/promise.js +18 -0
- package/vendor/node-addon-api/test/reference.cc +24 -0
- package/vendor/node-addon-api/test/reference.js +14 -0
- package/vendor/node-addon-api/test/run_script.cc +56 -0
- package/vendor/node-addon-api/test/run_script.js +45 -0
- package/vendor/node-addon-api/test/symbol.cc +79 -0
- package/vendor/node-addon-api/test/symbol.js +73 -0
- package/vendor/node-addon-api/test/testUtil.js +54 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.cc +195 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.js +188 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.cc +63 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.js +12 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.cc +115 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.js +14 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.cc +26 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.js +7 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.cc +225 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.js +59 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.cc +42 -0
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.js +53 -0
- package/vendor/node-addon-api/test/thunking_manual.cc +140 -0
- package/vendor/node-addon-api/test/thunking_manual.js +17 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.cc +215 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.js +188 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc +68 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.js +12 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.cc +127 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.js +14 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.cc +28 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.js +7 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.cc +237 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.js +59 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.cc +53 -0
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.js +53 -0
- package/vendor/node-addon-api/test/typedarray-bigint.js +58 -0
- package/vendor/node-addon-api/test/typedarray.cc +216 -0
- package/vendor/node-addon-api/test/typedarray.js +69 -0
- package/vendor/node-addon-api/test/version_management.cc +27 -0
- package/vendor/node-addon-api/test/version_management.js +31 -0
- package/vendor/node-addon-api/tools/README.md +73 -0
- package/vendor/node-addon-api/tools/check-napi.js +100 -0
- package/vendor/node-addon-api/tools/clang-format.js +68 -0
- package/vendor/node-addon-api/tools/conversion.js +309 -0
- package/vendor/node-addon-api/tools/eslint-format.js +71 -0
- package/build/ALL_BUILD.vcxproj +0 -190
- package/build/ALL_BUILD.vcxproj.filters +0 -8
- package/build/CMakeCache.txt +0 -429
- package/build/CMakeFiles/3.23.0-rc1/CMakeASMCompiler.cmake +0 -20
- package/build/CMakeFiles/3.23.0-rc1/CMakeASM_MASMCompiler.cmake +0 -20
- package/build/CMakeFiles/3.23.0-rc1/CMakeCCompiler.cmake +0 -72
- package/build/CMakeFiles/3.23.0-rc1/CMakeCXXCompiler.cmake +0 -83
- package/build/CMakeFiles/3.23.0-rc1/CMakeDetermineCompilerABI_C.bin +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CMakeDetermineCompilerABI_CXX.bin +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CMakeRCCompiler.cmake +0 -6
- package/build/CMakeFiles/3.23.0-rc1/CMakeSystem.cmake +0 -15
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CMakeCCompilerId.c +0 -828
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CompilerIdC.exe +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/CompilerIdC.vcxproj +0 -71
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CMakeCCompilerId.obj +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.exe.recipe +0 -11
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CL.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/CompilerIdC.lastbuildstate +0 -2
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdC/Debug/CompilerIdC.tlog/link.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -816
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CompilerIdCXX.exe +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/CompilerIdCXX.vcxproj +0 -71
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CMakeCXXCompilerId.obj +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.exe.recipe +0 -11
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CL.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/CompilerIdCXX.lastbuildstate +0 -2
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.command.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.read.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/CompilerIdCXX/Debug/CompilerIdCXX.tlog/link.write.1.tlog +0 -0
- package/build/CMakeFiles/3.23.0-rc1/VCTargetsPath.txt +0 -1
- package/build/CMakeFiles/3.23.0-rc1/VCTargetsPath.vcxproj +0 -31
- package/build/CMakeFiles/3.23.0-rc1/x64/Debug/VCTargetsPath.recipe +0 -11
- package/build/CMakeFiles/3.23.0-rc1/x64/Debug/VCTargetsPath.tlog/VCTargetsPath.lastbuildstate +0 -2
- package/build/CMakeFiles/41bcd16856091d4a38fd1f71fbe2f202/generate.stamp.rule +0 -1
- package/build/CMakeFiles/CMakeError.log +0 -108
- package/build/CMakeFiles/CMakeOutput.log +0 -413
- package/build/CMakeFiles/TargetDirectories.txt +0 -4
- package/build/CMakeFiles/cmake.check_cache +0 -1
- package/build/CMakeFiles/generate.stamp +0 -1
- package/build/CMakeFiles/generate.stamp.depend +0 -28
- package/build/CMakeFiles/generate.stamp.list +0 -1
- package/build/Raylib.dir/Release/Raylib.dll.recipe +0 -14
- package/build/Raylib.dir/Release/Raylib.tlog/CL.command.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/CL.read.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/CL.write.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.read.1.tlog +0 -27
- package/build/Raylib.dir/Release/Raylib.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/Raylib.dir/Release/Raylib.tlog/Raylib.lastbuildstate +0 -2
- package/build/Raylib.dir/Release/Raylib.tlog/Raylib.write.1u.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/link.command.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/link.read.1.tlog +0 -0
- package/build/Raylib.dir/Release/Raylib.tlog/link.write.1.tlog +0 -0
- package/build/Raylib.dir/Release/raudio.obj +0 -0
- package/build/Raylib.dir/Release/rcore.obj +0 -0
- package/build/Raylib.dir/Release/rglfw.obj +0 -0
- package/build/Raylib.dir/Release/rmodels.obj +0 -0
- package/build/Raylib.dir/Release/rshapes.obj +0 -0
- package/build/Raylib.dir/Release/rtext.obj +0 -0
- package/build/Raylib.dir/Release/rtextures.obj +0 -0
- package/build/Raylib.dir/Release/utils.obj +0 -0
- package/build/Raylib.vcxproj +0 -358
- package/build/Raylib.vcxproj.filters +0 -37
- package/build/Release/Raylib.dll +0 -0
- package/build/Release/Raylib.exp +0 -0
- package/build/Release/Raylib.lib +0 -0
- package/build/Release/koffi.exp +0 -0
- package/build/Release/koffi.lib +0 -0
- package/build/Release/koffi.node +0 -0
- package/build/ZERO_CHECK.vcxproj +0 -176
- package/build/ZERO_CHECK.vcxproj.filters +0 -13
- package/build/cmake_install.cmake +0 -44
- package/build/koffi.dir/Release/call_arm64.obj +0 -0
- package/build/koffi.dir/Release/call_x64_sysv.obj +0 -0
- package/build/koffi.dir/Release/call_x64_win.obj +0 -0
- package/build/koffi.dir/Release/call_x64_win_fwd.obj +0 -0
- package/build/koffi.dir/Release/call_x86.obj +0 -0
- package/build/koffi.dir/Release/ffi.obj +0 -0
- package/build/koffi.dir/Release/koffi.node.recipe +0 -14
- package/build/koffi.dir/Release/koffi.tlog/CL.command.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/CL.read.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/CL.write.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/koffi.dir/Release/koffi.tlog/CustomBuild.read.1.tlog +0 -27
- package/build/koffi.dir/Release/koffi.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/koffi.dir/Release/koffi.tlog/Masm.read.1u.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/Masm.write.1u.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/koffi.lastbuildstate +0 -2
- package/build/koffi.dir/Release/koffi.tlog/koffi.write.1u.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/link.command.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/link.read.1.tlog +0 -0
- package/build/koffi.dir/Release/koffi.tlog/link.write.1.tlog +0 -0
- package/build/koffi.dir/Release/libcc.obj +0 -0
- package/build/koffi.dir/Release/util.obj +0 -0
- package/build/koffi.dir/Release/win_delay_load_hook.obj +0 -0
- package/build/koffi.sln +0 -67
- package/build/koffi.vcxproj +0 -363
- package/build/koffi.vcxproj.filters +0 -40
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.recipe +0 -20
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/ALL_BUILD.lastbuildstate +0 -2
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.read.1.tlog +0 -27
- package/build/x64/Release/ALL_BUILD/ALL_BUILD.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.recipe +0 -11
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.command.1.tlog +0 -10
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.read.1.tlog +0 -28
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/CustomBuild.write.1.tlog +0 -2
- package/build/x64/Release/ZERO_CHECK/ZERO_CHECK.tlog/ZERO_CHECK.lastbuildstate +0 -2
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const majorNodeVersion = process.versions.node.split('.')[0];
|
|
4
|
+
|
|
5
|
+
if (typeof global.gc !== 'function') {
|
|
6
|
+
// Construct the correct (version-dependent) command-line args.
|
|
7
|
+
let args = ['--expose-gc'];
|
|
8
|
+
const majorV8Version = process.versions.v8.split('.')[0];
|
|
9
|
+
if (majorV8Version < 9) {
|
|
10
|
+
args.push('--no-concurrent-array-buffer-freeing');
|
|
11
|
+
}
|
|
12
|
+
if (majorNodeVersion >= 14) {
|
|
13
|
+
args.push('--no-concurrent-array-buffer-sweeping');
|
|
14
|
+
}
|
|
15
|
+
args.push(__filename);
|
|
16
|
+
|
|
17
|
+
const child = require('./napi_child').spawnSync(process.argv[0], args, {
|
|
18
|
+
stdio: 'inherit',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
if (child.signal) {
|
|
22
|
+
console.error(`Tests aborted with ${child.signal}`);
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
} else {
|
|
25
|
+
process.exitCode = child.status;
|
|
26
|
+
}
|
|
27
|
+
process.exit(process.exitCode);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const fs = require('fs');
|
|
31
|
+
const path = require('path');
|
|
32
|
+
|
|
33
|
+
let testModules = [];
|
|
34
|
+
|
|
35
|
+
// TODO(RaisinTen): Update this when the test filenames
|
|
36
|
+
// are changed into test_*.js.
|
|
37
|
+
function loadTestModules(currentDirectory = __dirname, pre = '') {
|
|
38
|
+
fs.readdirSync(currentDirectory).forEach((file) => {
|
|
39
|
+
if (currentDirectory === __dirname && (
|
|
40
|
+
file === 'binding.cc' ||
|
|
41
|
+
file === 'binding.gyp' ||
|
|
42
|
+
file === 'build' ||
|
|
43
|
+
file === 'common' ||
|
|
44
|
+
file === 'napi_child.js' ||
|
|
45
|
+
file === 'testUtil.js' ||
|
|
46
|
+
file === 'thunking_manual.cc' ||
|
|
47
|
+
file === 'thunking_manual.js' ||
|
|
48
|
+
file === 'index.js' ||
|
|
49
|
+
file[0] === '.')) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const absoluteFilepath = path.join(currentDirectory, file);
|
|
53
|
+
if (fs.statSync(absoluteFilepath).isDirectory()) {
|
|
54
|
+
if (fs.existsSync(absoluteFilepath + '/index.js')) {
|
|
55
|
+
testModules.push(pre + file);
|
|
56
|
+
} else {
|
|
57
|
+
loadTestModules(absoluteFilepath, pre + file + '/');
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
const parsedFilepath = path.parse(file);
|
|
61
|
+
if (parsedFilepath.ext === '.js') {
|
|
62
|
+
testModules.push(pre + parsedFilepath.name);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
loadTestModules();
|
|
69
|
+
|
|
70
|
+
process.config.target_defaults.default_configuration =
|
|
71
|
+
fs
|
|
72
|
+
.readdirSync(path.join(__dirname, 'build'))
|
|
73
|
+
.filter((item) => (item === 'Debug' || item === 'Release'))[0];
|
|
74
|
+
|
|
75
|
+
let napiVersion = Number(process.versions.napi);
|
|
76
|
+
if (process.env.NAPI_VERSION) {
|
|
77
|
+
// we need this so that we don't try run tests that rely
|
|
78
|
+
// on methods that are not available in the NAPI_VERSION
|
|
79
|
+
// specified
|
|
80
|
+
napiVersion = process.env.NAPI_VERSION;
|
|
81
|
+
}
|
|
82
|
+
console.log('napiVersion:' + napiVersion);
|
|
83
|
+
|
|
84
|
+
if (napiVersion < 3) {
|
|
85
|
+
testModules.splice(testModules.indexOf('env_cleanup'), 1);
|
|
86
|
+
testModules.splice(testModules.indexOf('callbackscope'), 1);
|
|
87
|
+
testModules.splice(testModules.indexOf('version_management'), 1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (napiVersion < 4) {
|
|
91
|
+
testModules.splice(testModules.indexOf('asyncprogressqueueworker'), 1);
|
|
92
|
+
testModules.splice(testModules.indexOf('asyncprogressworker'), 1);
|
|
93
|
+
testModules.splice(testModules.indexOf('threadsafe_function/threadsafe_function_ctx'), 1);
|
|
94
|
+
testModules.splice(testModules.indexOf('threadsafe_function/threadsafe_function_existing_tsfn'), 1);
|
|
95
|
+
testModules.splice(testModules.indexOf('threadsafe_function/threadsafe_function_ptr'), 1);
|
|
96
|
+
testModules.splice(testModules.indexOf('threadsafe_function/threadsafe_function_sum'), 1);
|
|
97
|
+
testModules.splice(testModules.indexOf('threadsafe_function/threadsafe_function_unref'), 1);
|
|
98
|
+
testModules.splice(testModules.indexOf('threadsafe_function/threadsafe_function'), 1);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (napiVersion < 5) {
|
|
102
|
+
testModules.splice(testModules.indexOf('date'), 1);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (napiVersion < 6) {
|
|
106
|
+
testModules.splice(testModules.indexOf('addon'), 1);
|
|
107
|
+
testModules.splice(testModules.indexOf('addon_data'), 1);
|
|
108
|
+
testModules.splice(testModules.indexOf('bigint'), 1);
|
|
109
|
+
testModules.splice(testModules.indexOf('typedarray-bigint'), 1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (majorNodeVersion < 12) {
|
|
113
|
+
testModules.splice(testModules.indexOf('objectwrap_worker_thread'), 1);
|
|
114
|
+
testModules.splice(testModules.indexOf('error_terminating_environment'), 1);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (napiVersion < 8) {
|
|
118
|
+
testModules.splice(testModules.indexOf('object/object_freeze_seal'), 1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
(async function() {
|
|
122
|
+
console.log(`Testing with Node-API Version '${napiVersion}'.`);
|
|
123
|
+
|
|
124
|
+
console.log('Starting test suite\n');
|
|
125
|
+
|
|
126
|
+
// Requiring each module runs tests in the module.
|
|
127
|
+
for (const name of testModules) {
|
|
128
|
+
console.log(`Running test '${name}'`);
|
|
129
|
+
await require('./' + name);
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
console.log('\nAll tests passed!');
|
|
133
|
+
})().catch((error) => {
|
|
134
|
+
console.log(error);
|
|
135
|
+
process.exit(1);
|
|
136
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#include "napi.h"
|
|
2
|
+
#if defined(NODE_ADDON_API_ENABLE_MAYBE)
|
|
3
|
+
|
|
4
|
+
using namespace Napi;
|
|
5
|
+
|
|
6
|
+
namespace {
|
|
7
|
+
|
|
8
|
+
void VoidCallback(const CallbackInfo& info) {
|
|
9
|
+
Function fn = info[0].As<Function>();
|
|
10
|
+
|
|
11
|
+
Maybe<Value> it = fn.Call({});
|
|
12
|
+
|
|
13
|
+
it.Check();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
} // end anonymous namespace
|
|
17
|
+
|
|
18
|
+
Object InitMaybeCheck(Env env) {
|
|
19
|
+
Object exports = Object::New(env);
|
|
20
|
+
exports.Set("voidCallback", Function::New(env, VoidCallback));
|
|
21
|
+
return exports;
|
|
22
|
+
}
|
|
23
|
+
#endif
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const buildType = process.config.target_defaults.default_configuration;
|
|
4
|
+
const assert = require('assert');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
const napiChild = require('../napi_child');
|
|
8
|
+
|
|
9
|
+
module.exports = test(require(`../build/${buildType}/binding_noexcept_maybe.node`).maybe_check);
|
|
10
|
+
|
|
11
|
+
function test(binding) {
|
|
12
|
+
if (process.argv.includes('child')) {
|
|
13
|
+
child(binding);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const cp = napiChild.spawn(process.execPath, [__filename, 'child'], {
|
|
17
|
+
stdio: ['ignore', 'inherit', 'pipe'],
|
|
18
|
+
});
|
|
19
|
+
cp.stderr.setEncoding('utf8');
|
|
20
|
+
let stderr = '';
|
|
21
|
+
cp.stderr.on('data', chunk => {
|
|
22
|
+
stderr += chunk;
|
|
23
|
+
});
|
|
24
|
+
cp.on('exit', (code, signal) => {
|
|
25
|
+
if (process.platform === 'win32') {
|
|
26
|
+
assert.strictEqual(code, 128 + 6 /* SIGABRT */);
|
|
27
|
+
} else {
|
|
28
|
+
assert.strictEqual(signal, 'SIGABRT');
|
|
29
|
+
}
|
|
30
|
+
assert.ok(stderr.match(/FATAL ERROR: Napi::Maybe::Check Maybe value is Nothing./));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function child(binding) {
|
|
35
|
+
binding.voidCallback(() => {
|
|
36
|
+
throw new Error('foobar');
|
|
37
|
+
})
|
|
38
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#include "napi.h"
|
|
2
|
+
|
|
3
|
+
using namespace Napi;
|
|
4
|
+
|
|
5
|
+
Value externalAllocatedMemory(const CallbackInfo& info) {
|
|
6
|
+
int64_t kSize = 1024 * 1024;
|
|
7
|
+
int64_t baseline = MemoryManagement::AdjustExternalMemory(info.Env(), 0);
|
|
8
|
+
int64_t tmp = MemoryManagement::AdjustExternalMemory(info.Env(), kSize);
|
|
9
|
+
tmp = MemoryManagement::AdjustExternalMemory(info.Env(), -kSize);
|
|
10
|
+
return Boolean::New(info.Env(), tmp == baseline);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
Object InitMemoryManagement(Env env) {
|
|
14
|
+
Object exports = Object::New(env);
|
|
15
|
+
exports["externalAllocatedMemory"] = Function::New(env, externalAllocatedMemory);
|
|
16
|
+
return exports;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#include "napi.h"
|
|
2
|
+
|
|
3
|
+
using namespace Napi;
|
|
4
|
+
|
|
5
|
+
Value createExternal(const CallbackInfo& info) {
|
|
6
|
+
FunctionReference ref = Reference<Function>::New(info[0].As<Function>(), 1);
|
|
7
|
+
auto ret = External<char>::New(
|
|
8
|
+
info.Env(),
|
|
9
|
+
nullptr,
|
|
10
|
+
[ref = std::move(ref)](Napi::Env /*env*/, char* /*data*/) {
|
|
11
|
+
ref.Call({});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return ret;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
Object InitMovableCallbacks(Env env) {
|
|
18
|
+
Object exports = Object::New(env);
|
|
19
|
+
|
|
20
|
+
exports["createExternal"] = Function::New(env, createExternal);
|
|
21
|
+
|
|
22
|
+
return exports;
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const common = require('./common');
|
|
4
|
+
const testUtil = require('./testUtil');
|
|
5
|
+
|
|
6
|
+
module.exports = require('./common').runTest(binding => test(binding.movable_callbacks));
|
|
7
|
+
|
|
8
|
+
async function test(binding) {
|
|
9
|
+
await testUtil.runGCTests([
|
|
10
|
+
'External',
|
|
11
|
+
() => {
|
|
12
|
+
const fn = common.mustCall(() => {
|
|
13
|
+
// noop
|
|
14
|
+
}, 1);
|
|
15
|
+
const external = binding.createExternal(fn);
|
|
16
|
+
},
|
|
17
|
+
() => {
|
|
18
|
+
// noop, wait for gc
|
|
19
|
+
}
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
#include "napi.h"
|
|
2
|
+
|
|
3
|
+
using namespace Napi;
|
|
4
|
+
|
|
5
|
+
const char* testValueUtf8 = "123456789";
|
|
6
|
+
const char16_t* testValueUtf16 = NAPI_WIDE_TEXT("123456789");
|
|
7
|
+
|
|
8
|
+
Value EchoString(const CallbackInfo& info) {
|
|
9
|
+
String value = info[0].As<String>();
|
|
10
|
+
String encoding = info[1].As<String>();
|
|
11
|
+
|
|
12
|
+
if (encoding.Utf8Value() == "utf8") {
|
|
13
|
+
return String::New(info.Env(), value.Utf8Value().c_str());
|
|
14
|
+
} else if (encoding.Utf8Value() == "utf16") {
|
|
15
|
+
return String::New(info.Env(), value.Utf16Value().c_str());
|
|
16
|
+
} else {
|
|
17
|
+
Error::New(info.Env(), "Invalid encoding.").ThrowAsJavaScriptException();
|
|
18
|
+
return Value();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Value CreateString(const CallbackInfo& info) {
|
|
23
|
+
String encoding = info[0].As<String>();
|
|
24
|
+
Number length = info[1].As<Number>();
|
|
25
|
+
|
|
26
|
+
if (encoding.Utf8Value() == "utf8") {
|
|
27
|
+
if (length.IsUndefined()) {
|
|
28
|
+
return String::New(info.Env(), testValueUtf8);
|
|
29
|
+
} else {
|
|
30
|
+
return String::New(info.Env(), testValueUtf8, length.Uint32Value());
|
|
31
|
+
}
|
|
32
|
+
} else if (encoding.Utf8Value() == "utf16") {
|
|
33
|
+
if (length.IsUndefined()) {
|
|
34
|
+
return String::New(info.Env(), testValueUtf16);
|
|
35
|
+
} else {
|
|
36
|
+
return String::New(info.Env(), testValueUtf16, length.Uint32Value());
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
Error::New(info.Env(), "Invalid encoding.").ThrowAsJavaScriptException();
|
|
40
|
+
return Value();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
Value CheckString(const CallbackInfo& info) {
|
|
45
|
+
String value = info[0].As<String>();
|
|
46
|
+
String encoding = info[1].As<String>();
|
|
47
|
+
Number length = info[2].As<Number>();
|
|
48
|
+
|
|
49
|
+
if (encoding.Utf8Value() == "utf8") {
|
|
50
|
+
std::string testValue = testValueUtf8;
|
|
51
|
+
if (!length.IsUndefined()) {
|
|
52
|
+
testValue = testValue.substr(0, length.Uint32Value());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
std::string stringValue = value;
|
|
56
|
+
return Boolean::New(info.Env(), stringValue == testValue);
|
|
57
|
+
} else if (encoding.Utf8Value() == "utf16") {
|
|
58
|
+
std::u16string testValue = testValueUtf16;
|
|
59
|
+
if (!length.IsUndefined()) {
|
|
60
|
+
testValue = testValue.substr(0, length.Uint32Value());
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
std::u16string stringValue = value;
|
|
64
|
+
return Boolean::New(info.Env(), stringValue == testValue);
|
|
65
|
+
} else {
|
|
66
|
+
Error::New(info.Env(), "Invalid encoding.").ThrowAsJavaScriptException();
|
|
67
|
+
return Value();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Value CreateSymbol(const CallbackInfo& info) {
|
|
72
|
+
String description = info[0].As<String>();
|
|
73
|
+
|
|
74
|
+
if (!description.IsUndefined()) {
|
|
75
|
+
return Symbol::New(info.Env(), description);
|
|
76
|
+
} else {
|
|
77
|
+
return Symbol::New(info.Env());
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Value CheckSymbol(const CallbackInfo& info) {
|
|
82
|
+
return Boolean::New(info.Env(), info[0].Type() == napi_symbol);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
void NullStringShouldThrow(const CallbackInfo& info) {
|
|
86
|
+
const char* nullStr = nullptr;
|
|
87
|
+
String::New(info.Env(), nullStr);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void NullString16ShouldThrow(const CallbackInfo& info) {
|
|
91
|
+
const char16_t* nullStr = nullptr;
|
|
92
|
+
String::New(info.Env(), nullStr);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
Object InitName(Env env) {
|
|
96
|
+
Object exports = Object::New(env);
|
|
97
|
+
|
|
98
|
+
exports["echoString"] = Function::New(env, EchoString);
|
|
99
|
+
exports["createString"] = Function::New(env, CreateString);
|
|
100
|
+
exports["nullStringShouldThrow"] = Function::New(env, NullStringShouldThrow);
|
|
101
|
+
exports["nullString16ShouldThrow"] =
|
|
102
|
+
Function::New(env, NullString16ShouldThrow);
|
|
103
|
+
exports["checkString"] = Function::New(env, CheckString);
|
|
104
|
+
exports["createSymbol"] = Function::New(env, CreateSymbol);
|
|
105
|
+
exports["checkSymbol"] = Function::New(env, CheckSymbol);
|
|
106
|
+
|
|
107
|
+
return exports;
|
|
108
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const assert = require('assert');
|
|
4
|
+
|
|
5
|
+
module.exports = require('./common').runTest(test);
|
|
6
|
+
|
|
7
|
+
function test(binding) {
|
|
8
|
+
const expected = '123456789';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
assert.throws(binding.name.nullStringShouldThrow, {
|
|
12
|
+
name: 'Error',
|
|
13
|
+
message: 'Error in native callback',
|
|
14
|
+
});
|
|
15
|
+
assert.ok(binding.name.checkString(expected, 'utf8'));
|
|
16
|
+
assert.ok(binding.name.checkString(expected, 'utf16'));
|
|
17
|
+
assert.ok(binding.name.checkString(expected.substr(0, 3), 'utf8', 3));
|
|
18
|
+
assert.ok(binding.name.checkString(expected.substr(0, 3), 'utf16', 3));
|
|
19
|
+
|
|
20
|
+
const str1 = binding.name.createString('utf8');
|
|
21
|
+
assert.strictEqual(str1, expected);
|
|
22
|
+
assert.ok(binding.name.checkString(str1, 'utf8'));
|
|
23
|
+
assert.ok(binding.name.checkString(str1, 'utf16'));
|
|
24
|
+
|
|
25
|
+
const substr1 = binding.name.createString('utf8', 3);
|
|
26
|
+
assert.strictEqual(substr1, expected.substr(0, 3));
|
|
27
|
+
assert.ok(binding.name.checkString(substr1, 'utf8', 3));
|
|
28
|
+
assert.ok(binding.name.checkString(substr1, 'utf16', 3));
|
|
29
|
+
|
|
30
|
+
const str2 = binding.name.createString('utf16');
|
|
31
|
+
assert.strictEqual(str1, expected);
|
|
32
|
+
assert.ok(binding.name.checkString(str2, 'utf8'));
|
|
33
|
+
assert.ok(binding.name.checkString(str2, 'utf16'));
|
|
34
|
+
|
|
35
|
+
const substr2 = binding.name.createString('utf16', 3);
|
|
36
|
+
assert.strictEqual(substr1, expected.substr(0, 3));
|
|
37
|
+
assert.ok(binding.name.checkString(substr2, 'utf8', 3));
|
|
38
|
+
assert.ok(binding.name.checkString(substr2, 'utf16', 3));
|
|
39
|
+
|
|
40
|
+
assert.ok(binding.name.checkSymbol(Symbol()));
|
|
41
|
+
assert.ok(binding.name.checkSymbol(Symbol('test')));
|
|
42
|
+
|
|
43
|
+
const sym1 = binding.name.createSymbol();
|
|
44
|
+
assert.strictEqual(typeof sym1, 'symbol');
|
|
45
|
+
assert.ok(binding.name.checkSymbol(sym1));
|
|
46
|
+
|
|
47
|
+
const sym2 = binding.name.createSymbol('test');
|
|
48
|
+
assert.strictEqual(typeof sym2, 'symbol');
|
|
49
|
+
assert.ok(binding.name.checkSymbol(sym1));
|
|
50
|
+
|
|
51
|
+
// Check for off-by-one errors which might only appear for strings of certain sizes,
|
|
52
|
+
// due to how std::string increments its capacity in chunks.
|
|
53
|
+
const longString = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
54
|
+
for (let i = 10; i <= longString.length; i++) {
|
|
55
|
+
const str = longString.substr(0, i);
|
|
56
|
+
assert.strictEqual(binding.name.echoString(str, 'utf8'), str);
|
|
57
|
+
assert.strictEqual(binding.name.echoString(str, 'utf16'), str);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Makes sure that child processes are spawned appropriately.
|
|
2
|
+
exports.spawnSync = function(command, args, options) {
|
|
3
|
+
if (require('../index').needsFlag) {
|
|
4
|
+
args.splice(0, 0, '--napi-modules');
|
|
5
|
+
}
|
|
6
|
+
return require('child_process').spawnSync(command, args, options);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
exports.spawn = function(command, args, options) {
|
|
10
|
+
if (require('../index').needsFlag) {
|
|
11
|
+
args.splice(0, 0, '--napi-modules');
|
|
12
|
+
}
|
|
13
|
+
return require('child_process').spawn(command, args, options);
|
|
14
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#include "napi.h"
|
|
2
|
+
#include "test_helper.h"
|
|
3
|
+
|
|
4
|
+
using namespace Napi;
|
|
5
|
+
|
|
6
|
+
Value DeletePropertyWithUint32(const CallbackInfo& info) {
|
|
7
|
+
Object obj = info[0].As<Object>();
|
|
8
|
+
Number key = info[1].As<Number>();
|
|
9
|
+
return Boolean::New(info.Env(), MaybeUnwrap(obj.Delete(key.Uint32Value())));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Value DeletePropertyWithNapiValue(const CallbackInfo& info) {
|
|
13
|
+
Object obj = info[0].As<Object>();
|
|
14
|
+
Name key = info[1].As<Name>();
|
|
15
|
+
return Boolean::New(
|
|
16
|
+
info.Env(),
|
|
17
|
+
MaybeUnwrapOr(obj.Delete(static_cast<napi_value>(key)), false));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Value DeletePropertyWithNapiWrapperValue(const CallbackInfo& info) {
|
|
21
|
+
Object obj = info[0].As<Object>();
|
|
22
|
+
Name key = info[1].As<Name>();
|
|
23
|
+
return Boolean::New(info.Env(), MaybeUnwrapOr(obj.Delete(key), false));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Value DeletePropertyWithCStyleString(const CallbackInfo& info) {
|
|
27
|
+
Object obj = info[0].As<Object>();
|
|
28
|
+
String jsKey = info[1].As<String>();
|
|
29
|
+
return Boolean::New(
|
|
30
|
+
info.Env(), MaybeUnwrapOr(obj.Delete(jsKey.Utf8Value().c_str()), false));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Value DeletePropertyWithCppStyleString(const CallbackInfo& info) {
|
|
34
|
+
Object obj = info[0].As<Object>();
|
|
35
|
+
String jsKey = info[1].As<String>();
|
|
36
|
+
return Boolean::New(info.Env(),
|
|
37
|
+
MaybeUnwrapOr(obj.Delete(jsKey.Utf8Value()), false));
|
|
38
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const assert = require('assert');
|
|
4
|
+
|
|
5
|
+
module.exports = require('../common').runTest(test);
|
|
6
|
+
|
|
7
|
+
function test(binding) {
|
|
8
|
+
function testDeleteProperty(nativeDeleteProperty) {
|
|
9
|
+
const obj = { one: 1, two: 2 };
|
|
10
|
+
Object.defineProperty(obj, "three", {configurable: false, value: 3});
|
|
11
|
+
assert.strictEqual(nativeDeleteProperty(obj, 'one'), true);
|
|
12
|
+
assert.strictEqual(nativeDeleteProperty(obj, 'missing'), true);
|
|
13
|
+
|
|
14
|
+
/* Returns true for all cases except when the property is an own non-
|
|
15
|
+
configurable property, in which case, false is returned in non-strict mode. */
|
|
16
|
+
assert.strictEqual(nativeDeleteProperty(obj, 'three'), false);
|
|
17
|
+
assert.deepStrictEqual(obj, { two: 2 });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function testShouldThrowErrorIfKeyIsInvalid(nativeDeleteProperty) {
|
|
21
|
+
assert.throws(() => {
|
|
22
|
+
nativeDeleteProperty(undefined, 'test');
|
|
23
|
+
}, /Cannot convert undefined or null to object/);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const testObj = { 15 : 42 , three: 3};
|
|
27
|
+
|
|
28
|
+
binding.object.deletePropertyWithUint32(testObj,15);
|
|
29
|
+
|
|
30
|
+
assert.strictEqual(testObj.hasOwnProperty(15),false);
|
|
31
|
+
|
|
32
|
+
testDeleteProperty(binding.object.deletePropertyWithNapiValue);
|
|
33
|
+
testDeleteProperty(binding.object.deletePropertyWithNapiWrapperValue);
|
|
34
|
+
testDeleteProperty(binding.object.deletePropertyWithCStyleString);
|
|
35
|
+
testDeleteProperty(binding.object.deletePropertyWithCppStyleString);
|
|
36
|
+
|
|
37
|
+
testShouldThrowErrorIfKeyIsInvalid(binding.object.deletePropertyWithNapiValue);
|
|
38
|
+
testShouldThrowErrorIfKeyIsInvalid(binding.object.deletePropertyWithNapiWrapperValue);
|
|
39
|
+
testShouldThrowErrorIfKeyIsInvalid(binding.object.deletePropertyWithCStyleString);
|
|
40
|
+
testShouldThrowErrorIfKeyIsInvalid(binding.object.deletePropertyWithCppStyleString);
|
|
41
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#include "napi.h"
|
|
2
|
+
|
|
3
|
+
using namespace Napi;
|
|
4
|
+
|
|
5
|
+
static int dummy;
|
|
6
|
+
|
|
7
|
+
Value AddFinalizer(const CallbackInfo& info) {
|
|
8
|
+
ObjectReference* ref = new ObjectReference;
|
|
9
|
+
*ref = Persistent(Object::New(info.Env()));
|
|
10
|
+
info[0]
|
|
11
|
+
.As<Object>()
|
|
12
|
+
.AddFinalizer([](Napi::Env /*env*/, ObjectReference* ref) {
|
|
13
|
+
ref->Set("finalizerCalled", true);
|
|
14
|
+
delete ref;
|
|
15
|
+
}, ref);
|
|
16
|
+
return ref->Value();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
Value AddFinalizerWithHint(const CallbackInfo& info) {
|
|
20
|
+
ObjectReference* ref = new ObjectReference;
|
|
21
|
+
*ref = Persistent(Object::New(info.Env()));
|
|
22
|
+
info[0]
|
|
23
|
+
.As<Object>()
|
|
24
|
+
.AddFinalizer([](Napi::Env /*env*/, ObjectReference* ref, int* dummy_p) {
|
|
25
|
+
ref->Set("finalizerCalledWithCorrectHint", dummy_p == &dummy);
|
|
26
|
+
delete ref;
|
|
27
|
+
}, ref, &dummy);
|
|
28
|
+
return ref->Value();
|
|
29
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const assert = require('assert');
|
|
4
|
+
const testUtil = require('../testUtil');
|
|
5
|
+
|
|
6
|
+
module.exports = require('../common').runTest(test);
|
|
7
|
+
|
|
8
|
+
function createWeakRef(binding, bindingToTest) {
|
|
9
|
+
return binding.object[bindingToTest]({});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function test(binding) {
|
|
13
|
+
let obj1;
|
|
14
|
+
let obj2;
|
|
15
|
+
return testUtil.runGCTests([
|
|
16
|
+
'addFinalizer',
|
|
17
|
+
() => {
|
|
18
|
+
obj1 = createWeakRef(binding, 'addFinalizer');
|
|
19
|
+
},
|
|
20
|
+
() => assert.deepStrictEqual(obj1, { finalizerCalled: true }),
|
|
21
|
+
|
|
22
|
+
'addFinalizerWithHint',
|
|
23
|
+
() => {
|
|
24
|
+
obj2 = createWeakRef(binding, 'addFinalizerWithHint');
|
|
25
|
+
},
|
|
26
|
+
() => assert.deepStrictEqual(obj2, { finalizerCalledWithCorrectHint: true })
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#include "napi.h"
|
|
2
|
+
#include "test_helper.h"
|
|
3
|
+
|
|
4
|
+
using namespace Napi;
|
|
5
|
+
|
|
6
|
+
Value GetPropertyWithNapiValue(const CallbackInfo& info) {
|
|
7
|
+
Object obj = info[0].As<Object>();
|
|
8
|
+
Name key = info[1].As<Name>();
|
|
9
|
+
return MaybeUnwrapOr(obj.Get(static_cast<napi_value>(key)), Value());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Value GetPropertyWithNapiWrapperValue(const CallbackInfo& info) {
|
|
13
|
+
Object obj = info[0].As<Object>();
|
|
14
|
+
Name key = info[1].As<Name>();
|
|
15
|
+
return MaybeUnwrapOr(obj.Get(key), Value());
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Value GetPropertyWithUint32(const CallbackInfo& info) {
|
|
19
|
+
Object obj = info[0].As<Object>();
|
|
20
|
+
Number key = info[1].As<Number>();
|
|
21
|
+
return MaybeUnwrap(obj.Get(key.Uint32Value()));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Value GetPropertyWithCStyleString(const CallbackInfo& info) {
|
|
25
|
+
Object obj = info[0].As<Object>();
|
|
26
|
+
String jsKey = info[1].As<String>();
|
|
27
|
+
return MaybeUnwrapOr(obj.Get(jsKey.Utf8Value().c_str()), Value());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Value GetPropertyWithCppStyleString(const CallbackInfo& info) {
|
|
31
|
+
Object obj = info[0].As<Object>();
|
|
32
|
+
String jsKey = info[1].As<String>();
|
|
33
|
+
return MaybeUnwrapOr(obj.Get(jsKey.Utf8Value()), Value());
|
|
34
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const assert = require('assert');
|
|
4
|
+
|
|
5
|
+
module.exports = require('../common').runTest(test);
|
|
6
|
+
|
|
7
|
+
function test(binding) {
|
|
8
|
+
function testGetProperty(nativeGetProperty) {
|
|
9
|
+
const obj = { test: 1 };
|
|
10
|
+
assert.strictEqual(nativeGetProperty(obj, 'test'), 1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function testShouldReturnUndefinedIfKeyIsNotPresent(nativeGetProperty) {
|
|
14
|
+
const obj = { };
|
|
15
|
+
assert.strictEqual(nativeGetProperty(obj, 'test'), undefined);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function testShouldThrowErrorIfKeyIsInvalid(nativeGetProperty) {
|
|
19
|
+
assert.throws(() => {
|
|
20
|
+
nativeGetProperty(undefined, 'test');
|
|
21
|
+
}, /Cannot convert undefined or null to object/);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const testObject = { 42: 100 };
|
|
25
|
+
const property = binding.object.getPropertyWithUint32(testObject, 42);
|
|
26
|
+
assert.strictEqual(property,100)
|
|
27
|
+
|
|
28
|
+
const nativeFunctions = [
|
|
29
|
+
binding.object.getPropertyWithNapiValue,
|
|
30
|
+
binding.object.getPropertyWithNapiWrapperValue,
|
|
31
|
+
binding.object.getPropertyWithCStyleString,
|
|
32
|
+
binding.object.getPropertyWithCppStyleString
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
nativeFunctions.forEach((nativeFunction) => {
|
|
36
|
+
testGetProperty(nativeFunction);
|
|
37
|
+
testShouldReturnUndefinedIfKeyIsNotPresent(nativeFunction);
|
|
38
|
+
testShouldThrowErrorIfKeyIsInvalid(nativeFunction);
|
|
39
|
+
});
|
|
40
|
+
}
|