koffi 0.9.33 → 0.9.34
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/README.md +65 -95
- package/package.json +1 -1
- package/src/call_arm32.cc +18 -8
- package/src/ffi.cc +1 -2
- package/vendor/node-addon-api/CODE_OF_CONDUCT.md +0 -4
- package/vendor/node-addon-api/CONTRIBUTING.md +0 -93
- package/vendor/node-addon-api/appveyor.yml +0 -37
- package/vendor/node-addon-api/benchmark/README.md +0 -47
- package/vendor/node-addon-api/benchmark/binding.gyp +0 -25
- package/vendor/node-addon-api/benchmark/function_args.cc +0 -217
- package/vendor/node-addon-api/benchmark/function_args.js +0 -60
- package/vendor/node-addon-api/benchmark/index.js +0 -34
- package/vendor/node-addon-api/benchmark/property_descriptor.cc +0 -91
- package/vendor/node-addon-api/benchmark/property_descriptor.js +0 -37
- package/vendor/node-addon-api/doc/addon.md +0 -163
- package/vendor/node-addon-api/doc/array.md +0 -81
- package/vendor/node-addon-api/doc/array_buffer.md +0 -155
- package/vendor/node-addon-api/doc/async_context.md +0 -86
- package/vendor/node-addon-api/doc/async_operations.md +0 -31
- package/vendor/node-addon-api/doc/async_worker.md +0 -427
- package/vendor/node-addon-api/doc/async_worker_variants.md +0 -557
- package/vendor/node-addon-api/doc/bigint.md +0 -97
- package/vendor/node-addon-api/doc/boolean.md +0 -68
- package/vendor/node-addon-api/doc/buffer.md +0 -150
- package/vendor/node-addon-api/doc/callback_scope.md +0 -54
- package/vendor/node-addon-api/doc/callbackinfo.md +0 -97
- package/vendor/node-addon-api/doc/checker-tool.md +0 -32
- package/vendor/node-addon-api/doc/class_property_descriptor.md +0 -123
- package/vendor/node-addon-api/doc/cmake-js.md +0 -68
- package/vendor/node-addon-api/doc/conversion-tool.md +0 -28
- package/vendor/node-addon-api/doc/creating_a_release.md +0 -62
- package/vendor/node-addon-api/doc/dataview.md +0 -248
- package/vendor/node-addon-api/doc/date.md +0 -68
- package/vendor/node-addon-api/doc/env.md +0 -196
- package/vendor/node-addon-api/doc/error.md +0 -120
- package/vendor/node-addon-api/doc/error_handling.md +0 -254
- package/vendor/node-addon-api/doc/escapable_handle_scope.md +0 -80
- package/vendor/node-addon-api/doc/external.md +0 -63
- package/vendor/node-addon-api/doc/function.md +0 -402
- package/vendor/node-addon-api/doc/function_reference.md +0 -238
- package/vendor/node-addon-api/doc/generator.md +0 -13
- package/vendor/node-addon-api/doc/handle_scope.md +0 -63
- package/vendor/node-addon-api/doc/hierarchy.md +0 -91
- package/vendor/node-addon-api/doc/instance_wrap.md +0 -408
- package/vendor/node-addon-api/doc/maybe.md +0 -76
- package/vendor/node-addon-api/doc/memory_management.md +0 -27
- package/vendor/node-addon-api/doc/name.md +0 -29
- package/vendor/node-addon-api/doc/node-gyp.md +0 -82
- package/vendor/node-addon-api/doc/number.md +0 -163
- package/vendor/node-addon-api/doc/object.md +0 -411
- package/vendor/node-addon-api/doc/object_lifetime_management.md +0 -83
- package/vendor/node-addon-api/doc/object_reference.md +0 -117
- package/vendor/node-addon-api/doc/object_wrap.md +0 -588
- package/vendor/node-addon-api/doc/prebuild_tools.md +0 -16
- package/vendor/node-addon-api/doc/promises.md +0 -79
- package/vendor/node-addon-api/doc/property_descriptor.md +0 -286
- package/vendor/node-addon-api/doc/propertylvalue.md +0 -50
- package/vendor/node-addon-api/doc/range_error.md +0 -59
- package/vendor/node-addon-api/doc/reference.md +0 -113
- package/vendor/node-addon-api/doc/setup.md +0 -110
- package/vendor/node-addon-api/doc/string.md +0 -93
- package/vendor/node-addon-api/doc/symbol.md +0 -61
- package/vendor/node-addon-api/doc/threadsafe.md +0 -121
- package/vendor/node-addon-api/doc/threadsafe_function.md +0 -290
- package/vendor/node-addon-api/doc/type_error.md +0 -59
- package/vendor/node-addon-api/doc/typed_array.md +0 -78
- package/vendor/node-addon-api/doc/typed_array_of.md +0 -137
- package/vendor/node-addon-api/doc/typed_threadsafe_function.md +0 -306
- package/vendor/node-addon-api/doc/value.md +0 -340
- package/vendor/node-addon-api/doc/version_management.md +0 -43
- package/vendor/node-addon-api/package.json +0 -415
- package/vendor/node-addon-api/test/README.md +0 -91
- package/vendor/node-addon-api/test/addon.cc +0 -36
- package/vendor/node-addon-api/test/addon.js +0 -11
- package/vendor/node-addon-api/test/addon_build/index.js +0 -49
- package/vendor/node-addon-api/test/addon_build/tpl/addon.cc +0 -17
- package/vendor/node-addon-api/test/addon_build/tpl/binding.gyp +0 -62
- package/vendor/node-addon-api/test/addon_build/tpl/index.js +0 -9
- package/vendor/node-addon-api/test/addon_build/tpl/package.json +0 -11
- package/vendor/node-addon-api/test/addon_data.cc +0 -99
- package/vendor/node-addon-api/test/addon_data.js +0 -46
- package/vendor/node-addon-api/test/array_buffer.cc +0 -243
- package/vendor/node-addon-api/test/array_buffer.js +0 -69
- package/vendor/node-addon-api/test/async_context.cc +0 -36
- package/vendor/node-addon-api/test/async_context.js +0 -122
- package/vendor/node-addon-api/test/async_progress_queue_worker.cc +0 -83
- package/vendor/node-addon-api/test/async_progress_queue_worker.js +0 -46
- package/vendor/node-addon-api/test/async_progress_worker.cc +0 -134
- package/vendor/node-addon-api/test/async_progress_worker.js +0 -61
- package/vendor/node-addon-api/test/async_worker.cc +0 -106
- package/vendor/node-addon-api/test/async_worker.js +0 -179
- package/vendor/node-addon-api/test/async_worker_nocallback.js +0 -13
- package/vendor/node-addon-api/test/async_worker_persistent.cc +0 -63
- package/vendor/node-addon-api/test/async_worker_persistent.js +0 -24
- package/vendor/node-addon-api/test/basic_types/array.cc +0 -40
- package/vendor/node-addon-api/test/basic_types/array.js +0 -35
- package/vendor/node-addon-api/test/basic_types/boolean.cc +0 -38
- package/vendor/node-addon-api/test/basic_types/boolean.js +0 -35
- package/vendor/node-addon-api/test/basic_types/number.cc +0 -99
- package/vendor/node-addon-api/test/basic_types/number.js +0 -114
- package/vendor/node-addon-api/test/basic_types/value.cc +0 -120
- package/vendor/node-addon-api/test/basic_types/value.js +0 -133
- package/vendor/node-addon-api/test/bigint.cc +0 -91
- package/vendor/node-addon-api/test/bigint.js +0 -53
- package/vendor/node-addon-api/test/binding-swallowexcept.cc +0 -12
- package/vendor/node-addon-api/test/binding.cc +0 -173
- package/vendor/node-addon-api/test/binding.gyp +0 -124
- package/vendor/node-addon-api/test/buffer.cc +0 -183
- package/vendor/node-addon-api/test/buffer.js +0 -69
- package/vendor/node-addon-api/test/callbackscope.cc +0 -22
- package/vendor/node-addon-api/test/callbackscope.js +0 -49
- package/vendor/node-addon-api/test/common/index.js +0 -114
- package/vendor/node-addon-api/test/common/test_helper.h +0 -71
- package/vendor/node-addon-api/test/dataview/dataview.cc +0 -48
- package/vendor/node-addon-api/test/dataview/dataview.js +0 -35
- package/vendor/node-addon-api/test/dataview/dataview_read_write.cc +0 -115
- package/vendor/node-addon-api/test/dataview/dataview_read_write.js +0 -90
- package/vendor/node-addon-api/test/date.cc +0 -44
- package/vendor/node-addon-api/test/date.js +0 -18
- package/vendor/node-addon-api/test/env_cleanup.cc +0 -88
- package/vendor/node-addon-api/test/env_cleanup.js +0 -56
- package/vendor/node-addon-api/test/error.cc +0 -287
- package/vendor/node-addon-api/test/error.js +0 -81
- package/vendor/node-addon-api/test/error_handling_for_primitives.cc +0 -13
- package/vendor/node-addon-api/test/error_handling_for_primitives.js +0 -29
- package/vendor/node-addon-api/test/error_terminating_environment.js +0 -95
- package/vendor/node-addon-api/test/external.cc +0 -81
- package/vendor/node-addon-api/test/external.js +0 -88
- package/vendor/node-addon-api/test/function.cc +0 -324
- package/vendor/node-addon-api/test/function.js +0 -133
- package/vendor/node-addon-api/test/function_reference.cc +0 -202
- package/vendor/node-addon-api/test/function_reference.js +0 -157
- package/vendor/node-addon-api/test/globalObject/global_object.cc +0 -61
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.cc +0 -31
- package/vendor/node-addon-api/test/globalObject/global_object_delete_property.js +0 -61
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.cc +0 -40
- package/vendor/node-addon-api/test/globalObject/global_object_get_property.js +0 -57
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.cc +0 -28
- package/vendor/node-addon-api/test/globalObject/global_object_has_own_property.js +0 -48
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.cc +0 -31
- package/vendor/node-addon-api/test/globalObject/global_object_set_property.js +0 -58
- package/vendor/node-addon-api/test/handlescope.cc +0 -60
- package/vendor/node-addon-api/test/handlescope.js +0 -14
- package/vendor/node-addon-api/test/index.js +0 -159
- package/vendor/node-addon-api/test/maybe/check.cc +0 -23
- package/vendor/node-addon-api/test/maybe/index.js +0 -38
- package/vendor/node-addon-api/test/memory_management.cc +0 -17
- package/vendor/node-addon-api/test/memory_management.js +0 -9
- package/vendor/node-addon-api/test/movable_callbacks.cc +0 -23
- package/vendor/node-addon-api/test/movable_callbacks.js +0 -21
- package/vendor/node-addon-api/test/name.cc +0 -108
- package/vendor/node-addon-api/test/name.js +0 -59
- package/vendor/node-addon-api/test/napi_child.js +0 -14
- package/vendor/node-addon-api/test/object/delete_property.cc +0 -38
- package/vendor/node-addon-api/test/object/delete_property.js +0 -41
- package/vendor/node-addon-api/test/object/finalizer.cc +0 -29
- package/vendor/node-addon-api/test/object/finalizer.js +0 -28
- package/vendor/node-addon-api/test/object/get_property.cc +0 -34
- package/vendor/node-addon-api/test/object/get_property.js +0 -40
- package/vendor/node-addon-api/test/object/has_own_property.cc +0 -34
- package/vendor/node-addon-api/test/object/has_own_property.js +0 -34
- package/vendor/node-addon-api/test/object/has_property.cc +0 -38
- package/vendor/node-addon-api/test/object/has_property.js +0 -37
- package/vendor/node-addon-api/test/object/object.cc +0 -350
- package/vendor/node-addon-api/test/object/object.js +0 -217
- package/vendor/node-addon-api/test/object/object_deprecated.cc +0 -66
- package/vendor/node-addon-api/test/object/object_deprecated.js +0 -47
- package/vendor/node-addon-api/test/object/object_freeze_seal.cc +0 -25
- package/vendor/node-addon-api/test/object/object_freeze_seal.js +0 -61
- package/vendor/node-addon-api/test/object/set_property.cc +0 -45
- package/vendor/node-addon-api/test/object/set_property.js +0 -30
- package/vendor/node-addon-api/test/object/subscript_operator.cc +0 -58
- package/vendor/node-addon-api/test/object/subscript_operator.js +0 -17
- package/vendor/node-addon-api/test/object_reference.cc +0 -219
- package/vendor/node-addon-api/test/object_reference.js +0 -259
- package/vendor/node-addon-api/test/objectwrap.cc +0 -268
- package/vendor/node-addon-api/test/objectwrap.js +0 -284
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.cc +0 -26
- package/vendor/node-addon-api/test/objectwrap_constructor_exception.js +0 -18
- package/vendor/node-addon-api/test/objectwrap_function.cc +0 -45
- package/vendor/node-addon-api/test/objectwrap_function.js +0 -22
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.cc +0 -30
- package/vendor/node-addon-api/test/objectwrap_multiple_inheritance.js +0 -13
- package/vendor/node-addon-api/test/objectwrap_removewrap.cc +0 -45
- package/vendor/node-addon-api/test/objectwrap_removewrap.js +0 -40
- package/vendor/node-addon-api/test/objectwrap_worker_thread.js +0 -19
- package/vendor/node-addon-api/test/promise.cc +0 -29
- package/vendor/node-addon-api/test/promise.js +0 -18
- package/vendor/node-addon-api/test/reference.cc +0 -24
- package/vendor/node-addon-api/test/reference.js +0 -14
- package/vendor/node-addon-api/test/run_script.cc +0 -56
- package/vendor/node-addon-api/test/run_script.js +0 -45
- package/vendor/node-addon-api/test/symbol.cc +0 -79
- package/vendor/node-addon-api/test/symbol.js +0 -73
- package/vendor/node-addon-api/test/testUtil.js +0 -54
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.cc +0 -195
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function.js +0 -188
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.cc +0 -63
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ctx.js +0 -12
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.cc +0 -115
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_existing_tsfn.js +0 -14
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.cc +0 -26
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_ptr.js +0 -7
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.cc +0 -225
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_sum.js +0 -59
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.cc +0 -42
- package/vendor/node-addon-api/test/threadsafe_function/threadsafe_function_unref.js +0 -53
- package/vendor/node-addon-api/test/thunking_manual.cc +0 -140
- package/vendor/node-addon-api/test/thunking_manual.js +0 -17
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.cc +0 -215
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function.js +0 -188
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.cc +0 -68
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ctx.js +0 -12
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.cc +0 -127
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_existing_tsfn.js +0 -14
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.cc +0 -28
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_ptr.js +0 -7
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.cc +0 -237
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_sum.js +0 -59
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.cc +0 -53
- package/vendor/node-addon-api/test/typed_threadsafe_function/typed_threadsafe_function_unref.js +0 -53
- package/vendor/node-addon-api/test/typedarray-bigint.js +0 -58
- package/vendor/node-addon-api/test/typedarray.cc +0 -216
- package/vendor/node-addon-api/test/typedarray.js +0 -69
- package/vendor/node-addon-api/test/version_management.cc +0 -27
- package/vendor/node-addon-api/test/version_management.js +0 -31
- package/vendor/node-addon-api/unit-test/README.md +0 -28
- package/vendor/node-addon-api/unit-test/binding-file-template.js +0 -39
- package/vendor/node-addon-api/unit-test/binding.gyp +0 -72
- package/vendor/node-addon-api/unit-test/exceptions.js +0 -32
- package/vendor/node-addon-api/unit-test/generate-binding-cc.js +0 -61
- package/vendor/node-addon-api/unit-test/injectTestParams.js +0 -101
- package/vendor/node-addon-api/unit-test/listOfTestModules.js +0 -88
- package/vendor/node-addon-api/unit-test/matchModules.js +0 -65
- package/vendor/node-addon-api/unit-test/setup.js +0 -13
- package/vendor/node-addon-api/unit-test/spawnTask.js +0 -26
- package/vendor/node-addon-api/unit-test/test.js +0 -30
- package/vendor/raylib/projects/VS2019/examples/audio_module_playing.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/audio_multichannel_sound.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/audio_music_stream.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/audio_raw_stream.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/audio_sound_loading.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_2d_camera.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_2d_camera_platformer.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_3d_camera_first_person.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_3d_camera_free.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_3d_camera_mode.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_3d_picking.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_basic_window.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_custom_logging.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_drop_files.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_input_gamepad.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_input_gestures.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_input_keys.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_input_mouse.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_input_mouse_wheel.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_input_multitouch.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_loading_thread.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_quat_conversion.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_random_values.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_scissor_test.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_split_screen.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_storage_values.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_vr_simulator.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_window_flags.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_window_letterbox.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/core_world_screen.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/easings_testbed.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/embedded_files_loading.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_animation.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_billboard.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_box_collisions.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_cubicmap.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_first_person_maze.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_geometric_shapes.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_heightmap.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_loading.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_loading_gltf.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_loading_vox.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_mesh_generation.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_mesh_picking.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_orthographic_projection.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_rlgl_solar_system.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_skybox.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_waving_cubes.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/models_yaw_pitch_roll.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/physics_demo.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/physics_friction.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/physics_movement.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/physics_restitution.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/physics_shatter.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/raudio_standalone.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/rlgl_standalone.vcxproj +0 -391
- package/vendor/raylib/projects/VS2019/examples/shaders_basic_lighting.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_custom_uniform.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_eratosthenes.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_fog.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_hot_reloading.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_julia_set.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_mesh_instancing.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_model_shader.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_multi_sample2d.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_palette_switch.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_postprocessing.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_raymarching.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_shapes_textures.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_simple_mask.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_spotlight.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_texture_drawing.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shaders_texture_waves.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_basic_shapes.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_bouncing_ball.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_collision_area.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_colors_palette.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_draw_circle_sector.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_draw_rectangle_rounded.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_draw_ring.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_easings_ball_anim.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_easings_box_anim.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_easings_rectangle_array.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_following_eyes.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_lines_bezier.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_logo_raylib.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_logo_raylib_anim.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/shapes_rectangle_scaling.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_font_filters.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_font_loading.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_font_sdf.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_font_spritefont.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_format_text.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_input_box.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_raylib_fonts.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_rectangle_bounds.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_unicode.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/text_writing_anim.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_background_scrolling.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_blend_modes.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_bunnymark.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_draw_tiled.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_image_drawing.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_image_generation.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_image_loading.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_image_processing.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_image_text.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_logo_raylib.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_mouse_painting.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_npatch_drawing.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_particles_blending.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_raw_data.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_rectangle.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_sprite_button.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_sprite_explosion.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_srcrec_dstrec.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/examples/textures_to_image.vcxproj +0 -387
- package/vendor/raylib/projects/VS2019/raylib/raylib.vcxproj +0 -341
- package/vendor/raylib/projects/VS2019/raylib.sln +0 -2274
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj +0 -226
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters +0 -10
- package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user +0 -4
- package/vendor/raylib/projects/VS2019-Android/raylib_android.sln +0 -75
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
# Error handling
|
|
2
|
-
|
|
3
|
-
Error handling represents one of the most important considerations when
|
|
4
|
-
implementing a Node.js native add-on. When an error occurs in your C++ code you
|
|
5
|
-
have to handle and dispatch it correctly. **node-addon-api** uses return values and
|
|
6
|
-
JavaScript exceptions for error handling. You can choose return values or
|
|
7
|
-
exception handling based on the mechanism that works best for your add-on.
|
|
8
|
-
|
|
9
|
-
The `Napi::Error` is a persistent reference (for more info see: [`Napi::ObjectReference`](object_reference.md))
|
|
10
|
-
to a JavaScript error object. Use of this class depends on whether C++
|
|
11
|
-
exceptions are enabled at compile time.
|
|
12
|
-
|
|
13
|
-
If C++ exceptions are enabled (for more info see: [Setup](setup.md)), then the
|
|
14
|
-
`Napi::Error` class extends `std::exception` and enables integrated
|
|
15
|
-
error-handling for C++ exceptions and JavaScript exceptions.
|
|
16
|
-
|
|
17
|
-
Note, that due to limitations of the Node-API, if one attempts to cast the error object wrapping a primitive inside a C++ addon, the wrapped object
|
|
18
|
-
will be received instead. (With property `4bda9e7e-4913-4dbc-95de-891cbf66598e-errorVal` containing the primitive value thrown)
|
|
19
|
-
|
|
20
|
-
The following sections explain the approach for each case:
|
|
21
|
-
|
|
22
|
-
- [Handling Errors With C++ Exceptions](#exceptions)
|
|
23
|
-
- [Handling Errors With Maybe Type and C++ Exceptions Disabled](#noexceptions-maybe)
|
|
24
|
-
- [Handling Errors Without C++ Exceptions](#noexceptions)
|
|
25
|
-
|
|
26
|
-
<a name="exceptions"></a>
|
|
27
|
-
|
|
28
|
-
In most cases when an error occurs, the addon should do whatever cleanup is possible
|
|
29
|
-
and then return to JavaScript so that the error can be propagated. In less frequent
|
|
30
|
-
cases the addon may be able to recover from the error, clear the error and then
|
|
31
|
-
continue.
|
|
32
|
-
|
|
33
|
-
## Handling Errors With C++ Exceptions
|
|
34
|
-
|
|
35
|
-
When C++ exceptions are enabled try/catch can be used to catch exceptions thrown
|
|
36
|
-
from calls to JavaScript and then they can either be handled or rethrown before
|
|
37
|
-
returning from a native method.
|
|
38
|
-
|
|
39
|
-
If a node-addon-api call fails without executing any JavaScript code (for example due to
|
|
40
|
-
an invalid argument), then node-addon-api automatically converts and throws
|
|
41
|
-
the error as a C++ exception of type `Napi::Error`.
|
|
42
|
-
|
|
43
|
-
If a JavaScript function called by C++ code via node-addon-api throws a JavaScript
|
|
44
|
-
exception, then node-addon-api automatically converts and throws it as a C++
|
|
45
|
-
exception of type `Napi::Error` on return from the JavaScript code to the native
|
|
46
|
-
method.
|
|
47
|
-
|
|
48
|
-
If a C++ exception of type `Napi::Error` escapes from a Node-API C++ callback, then
|
|
49
|
-
the Node-API wrapper automatically converts and throws it as a JavaScript exception.
|
|
50
|
-
|
|
51
|
-
On return from a native method, node-addon-api will automatically convert a pending C++
|
|
52
|
-
exception to a JavaScript exception.
|
|
53
|
-
|
|
54
|
-
When C++ exceptions are enabled try/catch can be used to catch exceptions thrown
|
|
55
|
-
from calls to JavaScript and then they can either be handled or rethrown before
|
|
56
|
-
returning from a native method.
|
|
57
|
-
|
|
58
|
-
## Examples with C++ exceptions enabled
|
|
59
|
-
|
|
60
|
-
### Throwing a C++ exception
|
|
61
|
-
|
|
62
|
-
```cpp
|
|
63
|
-
Env env = ...
|
|
64
|
-
throw Napi::Error::New(env, "Example exception");
|
|
65
|
-
// other C++ statements
|
|
66
|
-
// ...
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
The statements following the throw statement will not be executed. The exception
|
|
70
|
-
will bubble up as a C++ exception of type `Napi::Error`, until it is either caught
|
|
71
|
-
while still in C++, or else automatically propagated as a JavaScript exception
|
|
72
|
-
when returning to JavaScript.
|
|
73
|
-
|
|
74
|
-
### Propagating a Node-API C++ exception
|
|
75
|
-
|
|
76
|
-
```cpp
|
|
77
|
-
Napi::Function jsFunctionThatThrows = someValue.As<Napi::Function>();
|
|
78
|
-
Napi::Value result = jsFunctionThatThrows({ arg1, arg2 });
|
|
79
|
-
// other C++ statements
|
|
80
|
-
// ...
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
The C++ statements following the call to the JavaScript function will not be
|
|
84
|
-
executed. The exception will bubble up as a C++ exception of type `Napi::Error`,
|
|
85
|
-
until it is either caught while still in C++, or else automatically propagated as
|
|
86
|
-
a JavaScript exception when returning to JavaScript.
|
|
87
|
-
|
|
88
|
-
### Handling a Node-API C++ exception
|
|
89
|
-
|
|
90
|
-
```cpp
|
|
91
|
-
Napi::Function jsFunctionThatThrows = someValue.As<Napi::Function>();
|
|
92
|
-
Napi::Value result;
|
|
93
|
-
try {
|
|
94
|
-
result = jsFunctionThatThrows({ arg1, arg2 });
|
|
95
|
-
} catch (const Error& e) {
|
|
96
|
-
cerr << "Caught JavaScript exception: " + e.what();
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Since the exception was caught here, it will not be propagated as a JavaScript
|
|
101
|
-
exception.
|
|
102
|
-
|
|
103
|
-
<a name="noexceptions-maybe"></a>
|
|
104
|
-
|
|
105
|
-
## Handling Errors With Maybe Type and C++ Exceptions Disabled
|
|
106
|
-
|
|
107
|
-
If C++ exceptions are disabled (for more info see: [Setup](setup.md)), then the
|
|
108
|
-
`Napi::Error` class does not extend `std::exception`. This means that any calls to
|
|
109
|
-
node-addon-api functions do not throw a C++ exceptions. Instead, these node-api
|
|
110
|
-
functions that call into JavaScript are returning with `Maybe` boxed values.
|
|
111
|
-
In that case, the calling side should convert the `Maybe` boxed values with
|
|
112
|
-
checks to ensure that the call did succeed and therefore no exception is pending.
|
|
113
|
-
If the check fails, that is to say, the returning value is _empty_, the calling
|
|
114
|
-
side should determine what to do with `env.GetAndClearPendingException()` before
|
|
115
|
-
attempting to call another node-api (for more info see: [Env](env.md)).
|
|
116
|
-
|
|
117
|
-
The conversion from the `Maybe` boxed value to the actual return value is
|
|
118
|
-
enforced by compilers so that the exceptions must be properly handled before
|
|
119
|
-
continuing.
|
|
120
|
-
|
|
121
|
-
## Examples with Maybe Type and C++ exceptions disabled
|
|
122
|
-
|
|
123
|
-
### Throwing a JS exception
|
|
124
|
-
|
|
125
|
-
```cpp
|
|
126
|
-
Napi::Env env = ...
|
|
127
|
-
Napi::Error::New(env, "Example exception").ThrowAsJavaScriptException();
|
|
128
|
-
return;
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
After throwing a JavaScript exception, the code should generally return
|
|
132
|
-
immediately from the native callback, after performing any necessary cleanup.
|
|
133
|
-
|
|
134
|
-
### Propagating a Node-API JS exception
|
|
135
|
-
|
|
136
|
-
```cpp
|
|
137
|
-
Napi::Env env = ...
|
|
138
|
-
Napi::Function jsFunctionThatThrows = someValue.As<Napi::Function>();
|
|
139
|
-
Maybe<Napi::Value> maybeResult = jsFunctionThatThrows({ arg1, arg2 });
|
|
140
|
-
Napi::Value result;
|
|
141
|
-
if (!maybeResult.To(&result)) {
|
|
142
|
-
// The Maybe is empty, calling into js failed, cleaning up...
|
|
143
|
-
// It is recommended to return an empty Maybe if the procedure failed.
|
|
144
|
-
return result;
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
If `maybeResult.To(&result)` returns false a JavaScript exception is pending.
|
|
149
|
-
To let the exception propagate, the code should generally return immediately
|
|
150
|
-
from the native callback, after performing any necessary cleanup.
|
|
151
|
-
|
|
152
|
-
### Handling a Node-API JS exception
|
|
153
|
-
|
|
154
|
-
```cpp
|
|
155
|
-
Napi::Env env = ...
|
|
156
|
-
Napi::Function jsFunctionThatThrows = someValue.As<Napi::Function>();
|
|
157
|
-
Maybe<Napi::Value> maybeResult = jsFunctionThatThrows({ arg1, arg2 });
|
|
158
|
-
if (maybeResult.IsNothing()) {
|
|
159
|
-
Napi::Error e = env.GetAndClearPendingException();
|
|
160
|
-
cerr << "Caught JavaScript exception: " + e.Message();
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Since the exception was cleared here, it will not be propagated as a JavaScript
|
|
165
|
-
exception after the native callback returns.
|
|
166
|
-
|
|
167
|
-
<a name="noexceptions"></a>
|
|
168
|
-
|
|
169
|
-
## Handling Errors Without C++ Exceptions
|
|
170
|
-
|
|
171
|
-
If C++ exceptions are disabled (for more info see: [Setup](setup.md)), then the
|
|
172
|
-
`Napi::Error` class does not extend `std::exception`. This means that any calls to
|
|
173
|
-
node-addon-api function do not throw a C++ exceptions. Instead, it raises
|
|
174
|
-
_pending_ JavaScript exceptions and returns an _empty_ `Napi::Value`.
|
|
175
|
-
The calling code should check `env.IsExceptionPending()` before attempting to use a
|
|
176
|
-
returned value, and may use methods on the `Napi::Env` class
|
|
177
|
-
to check for, get, and clear a pending JavaScript exception (for more info see: [Env](env.md)).
|
|
178
|
-
If the pending exception is not cleared, it will be thrown when the native code
|
|
179
|
-
returns to JavaScript.
|
|
180
|
-
|
|
181
|
-
## Examples with C++ exceptions disabled
|
|
182
|
-
|
|
183
|
-
### Throwing a JS exception
|
|
184
|
-
|
|
185
|
-
```cpp
|
|
186
|
-
Napi::Env env = ...
|
|
187
|
-
Napi::Error::New(env, "Example exception").ThrowAsJavaScriptException();
|
|
188
|
-
return;
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
After throwing a JavaScript exception, the code should generally return
|
|
192
|
-
immediately from the native callback, after performing any necessary cleanup.
|
|
193
|
-
|
|
194
|
-
### Propagating a Node-API JS exception
|
|
195
|
-
|
|
196
|
-
```cpp
|
|
197
|
-
Napi::Env env = ...
|
|
198
|
-
Napi::Function jsFunctionThatThrows = someValue.As<Napi::Function>();
|
|
199
|
-
Napi::Value result = jsFunctionThatThrows({ arg1, arg2 });
|
|
200
|
-
if (env.IsExceptionPending()) {
|
|
201
|
-
Error e = env.GetAndClearPendingException();
|
|
202
|
-
return e.Value();
|
|
203
|
-
}
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
If env.IsExceptionPending() returns true a JavaScript exception is pending. To
|
|
207
|
-
let the exception propagate, the code should generally return immediately from
|
|
208
|
-
the native callback, after performing any necessary cleanup.
|
|
209
|
-
|
|
210
|
-
### Handling a Node-API JS exception
|
|
211
|
-
|
|
212
|
-
```cpp
|
|
213
|
-
Napi::Env env = ...
|
|
214
|
-
Napi::Function jsFunctionThatThrows = someValue.As<Napi::Function>();
|
|
215
|
-
Napi::Value result = jsFunctionThatThrows({ arg1, arg2 });
|
|
216
|
-
if (env.IsExceptionPending()) {
|
|
217
|
-
Napi::Error e = env.GetAndClearPendingException();
|
|
218
|
-
cerr << "Caught JavaScript exception: " + e.Message();
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Since the exception was cleared here, it will not be propagated as a JavaScript
|
|
223
|
-
exception after the native callback returns.
|
|
224
|
-
|
|
225
|
-
## Calling Node-API directly from a **node-addon-api** addon
|
|
226
|
-
|
|
227
|
-
**node-addon-api** provides macros for throwing errors in response to non-OK
|
|
228
|
-
`napi_status` results when calling [Node-API](https://nodejs.org/docs/latest/api/n-api.html)
|
|
229
|
-
functions from within a native addon. These macros are defined differently
|
|
230
|
-
depending on whether C++ exceptions are enabled or not, but are available for
|
|
231
|
-
use in either case.
|
|
232
|
-
|
|
233
|
-
### `NAPI_THROW(e, ...)`
|
|
234
|
-
|
|
235
|
-
This macro accepts a `Napi::Error`, throws it, and returns the value given as
|
|
236
|
-
the last parameter. If C++ exceptions are enabled (by defining
|
|
237
|
-
`NAPI_CPP_EXCEPTIONS` during the build), the return value will be ignored.
|
|
238
|
-
|
|
239
|
-
### `NAPI_THROW_IF_FAILED(env, status, ...)`
|
|
240
|
-
|
|
241
|
-
This macro accepts a `Napi::Env` and a `napi_status`. It constructs an error
|
|
242
|
-
from the `napi_status`, throws it, and returns the value given as the last
|
|
243
|
-
parameter. If C++ exceptions are enabled (by defining `NAPI_CPP_EXCEPTIONS`
|
|
244
|
-
during the build), the return value will be ignored.
|
|
245
|
-
|
|
246
|
-
### `NAPI_THROW_IF_FAILED_VOID(env, status)`
|
|
247
|
-
|
|
248
|
-
This macro accepts a `Napi::Env` and a `napi_status`. It constructs an error
|
|
249
|
-
from the `napi_status`, throws it, and returns.
|
|
250
|
-
|
|
251
|
-
### `NAPI_FATAL_IF_FAILED(status, location, message)`
|
|
252
|
-
|
|
253
|
-
This macro accepts a `napi_status`, a C string indicating the location where the
|
|
254
|
-
error occurred, and a second C string for the message to display.
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# EscapableHandleScope
|
|
2
|
-
|
|
3
|
-
The `Napi::EscapableHandleScope` class is used to manage the lifetime of object handles
|
|
4
|
-
which are created through the use of node-addon-api. These handles
|
|
5
|
-
keep an object alive in the heap in order to ensure that the objects
|
|
6
|
-
are not collected by the garbage collector while native code is using them.
|
|
7
|
-
A handle may be created when any new node-addon-api Value or one
|
|
8
|
-
of its subclasses is created or returned.
|
|
9
|
-
|
|
10
|
-
The `Napi::EscapableHandleScope` is a special type of `Napi::HandleScope`
|
|
11
|
-
which allows a single handle to be "promoted" to an outer scope.
|
|
12
|
-
|
|
13
|
-
For more details refer to the section titled
|
|
14
|
-
[Object lifetime management](object_lifetime_management.md).
|
|
15
|
-
|
|
16
|
-
## Methods
|
|
17
|
-
|
|
18
|
-
### Constructor
|
|
19
|
-
|
|
20
|
-
Creates a new escapable handle scope.
|
|
21
|
-
|
|
22
|
-
```cpp
|
|
23
|
-
Napi::EscapableHandleScope Napi::EscapableHandleScope::New(Napi::Env env);
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- `[in] Env`: The environment in which to construct the `Napi::EscapableHandleScope` object.
|
|
27
|
-
|
|
28
|
-
Returns a new `Napi::EscapableHandleScope`
|
|
29
|
-
|
|
30
|
-
### Constructor
|
|
31
|
-
|
|
32
|
-
Creates a new escapable handle scope.
|
|
33
|
-
|
|
34
|
-
```cpp
|
|
35
|
-
Napi::EscapableHandleScope Napi::EscapableHandleScope::New(napi_env env, napi_handle_scope scope);
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
- `[in] env`: `napi_env` in which the scope passed in was created.
|
|
39
|
-
- `[in] scope`: pre-existing `napi_handle_scope`.
|
|
40
|
-
|
|
41
|
-
Returns a new `Napi::EscapableHandleScope` instance which wraps the
|
|
42
|
-
`napi_escapable_handle_scope` handle passed in. This can be used
|
|
43
|
-
to mix usage of the C Node-API and node-addon-api.
|
|
44
|
-
|
|
45
|
-
```cpp
|
|
46
|
-
operator Napi::EscapableHandleScope::napi_escapable_handle_scope() const
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Returns the Node-API `napi_escapable_handle_scope` wrapped by the `Napi::EscapableHandleScope` object.
|
|
50
|
-
This can be used to mix usage of the C Node-API and node-addon-api by allowing
|
|
51
|
-
the class to be used be converted to a `napi_escapable_handle_scope`.
|
|
52
|
-
|
|
53
|
-
### Destructor
|
|
54
|
-
```cpp
|
|
55
|
-
Napi::EscapableHandleScope::~EscapableHandleScope();
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Deletes the `Napi::EscapableHandleScope` instance and allows any objects/handles created
|
|
59
|
-
in the scope to be collected by the garbage collector. There is no
|
|
60
|
-
guarantee as to when the garbage collector will do this.
|
|
61
|
-
|
|
62
|
-
### Escape
|
|
63
|
-
|
|
64
|
-
```cpp
|
|
65
|
-
napi::Value Napi::EscapableHandleScope::Escape(napi_value escapee);
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
- `[in] escapee`: `Napi::Value` or `napi_env` to promote to the outer scope
|
|
69
|
-
|
|
70
|
-
Returns `Napi::Value` which can be used in the outer scope. This method can
|
|
71
|
-
be called at most once on a given `Napi::EscapableHandleScope`. If it is called
|
|
72
|
-
more than once an exception will be thrown.
|
|
73
|
-
|
|
74
|
-
### Env
|
|
75
|
-
|
|
76
|
-
```cpp
|
|
77
|
-
Napi::Env Napi::EscapableHandleScope::Env() const;
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Returns the `Napi::Env` associated with the `Napi::EscapableHandleScope`.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# External (template)
|
|
2
|
-
|
|
3
|
-
Class `Napi::External<T>` inherits from class [`Napi::Value`][].
|
|
4
|
-
|
|
5
|
-
The `Napi::External` template class implements the ability to create a `Napi::Value` object with arbitrary C++ data. It is the user's responsibility to manage the memory for the arbitrary C++ data.
|
|
6
|
-
|
|
7
|
-
`Napi::External` objects can be created with an optional Finalizer function and optional Hint value. The Finalizer function, if specified, is called when your `Napi::External` object is released by Node's garbage collector. It gives your code the opportunity to free any dynamically created data. If you specify a Hint value, it is passed to your Finalizer function.
|
|
8
|
-
|
|
9
|
-
## Methods
|
|
10
|
-
|
|
11
|
-
### New
|
|
12
|
-
|
|
13
|
-
```cpp
|
|
14
|
-
template <typename T>
|
|
15
|
-
static Napi::External Napi::External::New(napi_env env, T* data);
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
- `[in] env`: The `napi_env` environment in which to construct the `Napi::External` object.
|
|
19
|
-
- `[in] data`: The arbitrary C++ data to be held by the `Napi::External` object.
|
|
20
|
-
|
|
21
|
-
Returns the created `Napi::External<T>` object.
|
|
22
|
-
|
|
23
|
-
### New
|
|
24
|
-
|
|
25
|
-
```cpp
|
|
26
|
-
template <typename T>
|
|
27
|
-
static Napi::External Napi::External::New(napi_env env,
|
|
28
|
-
T* data,
|
|
29
|
-
Finalizer finalizeCallback);
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
- `[in] env`: The `napi_env` environment in which to construct the `Napi::External` object.
|
|
33
|
-
- `[in] data`: The arbitrary C++ data to be held by the `Napi::External` object.
|
|
34
|
-
- `[in] finalizeCallback`: A function called when the `Napi::External` object is released by the garbage collector accepting a T* and returning void.
|
|
35
|
-
|
|
36
|
-
Returns the created `Napi::External<T>` object.
|
|
37
|
-
|
|
38
|
-
### New
|
|
39
|
-
|
|
40
|
-
```cpp
|
|
41
|
-
template <typename T>
|
|
42
|
-
static Napi::External Napi::External::New(napi_env env,
|
|
43
|
-
T* data,
|
|
44
|
-
Finalizer finalizeCallback,
|
|
45
|
-
Hint* finalizeHint);
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
- `[in] env`: The `napi_env` environment in which to construct the `Napi::External` object.
|
|
49
|
-
- `[in] data`: The arbitrary C++ data to be held by the `Napi::External` object.
|
|
50
|
-
- `[in] finalizeCallback`: A function called when the `Napi::External` object is released by the garbage collector accepting T* and Hint* parameters and returning void.
|
|
51
|
-
- `[in] finalizeHint`: A hint value passed to the `finalizeCallback` function.
|
|
52
|
-
|
|
53
|
-
Returns the created `Napi::External<T>` object.
|
|
54
|
-
|
|
55
|
-
### Data
|
|
56
|
-
|
|
57
|
-
```cpp
|
|
58
|
-
T* Napi::External::Data() const;
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Returns a pointer to the arbitrary C++ data held by the `Napi::External` object.
|
|
62
|
-
|
|
63
|
-
[`Napi::Value`]: ./value.md
|