koffi 2.1.0-beta.3 → 2.1.0

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.
Files changed (250) hide show
  1. package/ChangeLog.md +2 -1
  2. package/build/qemu/2.1.0/koffi_darwin_arm64.tar.gz +0 -0
  3. package/build/qemu/2.1.0/koffi_darwin_x64.tar.gz +0 -0
  4. package/build/qemu/2.1.0/koffi_freebsd_arm64.tar.gz +0 -0
  5. package/build/qemu/2.1.0/koffi_freebsd_ia32.tar.gz +0 -0
  6. package/build/qemu/2.1.0/koffi_freebsd_x64.tar.gz +0 -0
  7. package/build/qemu/2.1.0/koffi_linux_arm32hf.tar.gz +0 -0
  8. package/build/qemu/2.1.0/koffi_linux_arm64.tar.gz +0 -0
  9. package/build/qemu/2.1.0/koffi_linux_ia32.tar.gz +0 -0
  10. package/build/qemu/2.1.0/koffi_linux_riscv64hf64.tar.gz +0 -0
  11. package/build/qemu/2.1.0/koffi_linux_x64.tar.gz +0 -0
  12. package/build/qemu/2.1.0/koffi_openbsd_ia32.tar.gz +0 -0
  13. package/build/qemu/2.1.0/koffi_openbsd_x64.tar.gz +0 -0
  14. package/build/qemu/2.1.0/koffi_win32_arm64.tar.gz +0 -0
  15. package/build/qemu/2.1.0/koffi_win32_ia32.tar.gz +0 -0
  16. package/build/qemu/2.1.0/koffi_win32_x64.tar.gz +0 -0
  17. package/doc/benchmarks.md +14 -14
  18. package/doc/benchmarks.xlsx +0 -0
  19. package/doc/index.rst +2 -2
  20. package/doc/static/perf_linux_20220812.png +0 -0
  21. package/doc/static/perf_windows_20220812.png +0 -0
  22. package/doc/types.md +10 -12
  23. package/package.json +2 -2
  24. package/qemu/registry/machines.json +2 -2
  25. package/qemu/registry/sha256sum.txt +2 -2
  26. package/src/abi_arm32.cc +23 -55
  27. package/src/abi_arm64.cc +22 -54
  28. package/src/abi_riscv64.cc +20 -52
  29. package/src/abi_x64_sysv.cc +20 -52
  30. package/src/abi_x64_win.cc +20 -52
  31. package/src/abi_x86.cc +24 -56
  32. package/src/call.cc +117 -143
  33. package/src/call.hh +4 -4
  34. package/src/ffi.cc +16 -4
  35. package/src/util.hh +0 -20
  36. package/test/callbacks.js +3 -3
  37. package/test/misc.c +2 -2
  38. package/test/sync.js +2 -2
  39. package/vendor/libcc/libcc.cc +75 -55
  40. package/vendor/libcc/libcc.hh +306 -255
  41. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj +226 -0
  42. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.filters +10 -0
  43. package/vendor/raylib/projects/VS2019-Android/raylib_android/raylib_android.NativeActivity/raylib_android.NativeActivity.vcxproj.user +4 -0
  44. package/vendor/raylib/projects/VS2019-Android/raylib_android.sln +75 -0
  45. package/vendor/raylib/projects/VS2022/examples/audio_module_playing.vcxproj +390 -0
  46. package/vendor/raylib/projects/VS2022/examples/audio_multichannel_sound.vcxproj +390 -0
  47. package/vendor/raylib/projects/VS2022/examples/audio_music_stream.vcxproj +390 -0
  48. package/vendor/raylib/projects/VS2022/examples/audio_raw_stream.vcxproj +390 -0
  49. package/vendor/raylib/projects/VS2022/examples/audio_sound_loading.vcxproj +390 -0
  50. package/vendor/raylib/projects/VS2022/examples/audio_stream_effects.vcxproj +390 -0
  51. package/vendor/raylib/projects/VS2022/examples/core_2d_camera.vcxproj +390 -0
  52. package/vendor/raylib/projects/VS2022/examples/core_2d_camera_mouse_zoom.vcxproj +390 -0
  53. package/vendor/raylib/projects/VS2022/examples/core_2d_camera_platformer.vcxproj +390 -0
  54. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_first_person.vcxproj +390 -0
  55. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_free.vcxproj +390 -0
  56. package/vendor/raylib/projects/VS2022/examples/core_3d_camera_mode.vcxproj +390 -0
  57. package/vendor/raylib/projects/VS2022/examples/core_3d_picking.vcxproj +390 -0
  58. package/vendor/raylib/projects/VS2022/examples/core_basic_screen_manager.vcxproj +390 -0
  59. package/vendor/raylib/projects/VS2022/examples/core_basic_window.vcxproj +390 -0
  60. package/vendor/raylib/projects/VS2022/examples/core_custom_frame_control.vcxproj +390 -0
  61. package/vendor/raylib/projects/VS2022/examples/core_custom_logging.vcxproj +390 -0
  62. package/vendor/raylib/projects/VS2022/examples/core_drop_files.vcxproj +390 -0
  63. package/vendor/raylib/projects/VS2022/examples/core_input_gamepad.vcxproj +387 -0
  64. package/vendor/raylib/projects/VS2022/examples/core_input_gestures.vcxproj +387 -0
  65. package/vendor/raylib/projects/VS2022/examples/core_input_keys.vcxproj +387 -0
  66. package/vendor/raylib/projects/VS2022/examples/core_input_mouse.vcxproj +387 -0
  67. package/vendor/raylib/projects/VS2022/examples/core_input_mouse_wheel.vcxproj +387 -0
  68. package/vendor/raylib/projects/VS2022/examples/core_input_multitouch.vcxproj +387 -0
  69. package/vendor/raylib/projects/VS2022/examples/core_loading_thread.vcxproj +387 -0
  70. package/vendor/raylib/projects/VS2022/examples/core_random_values.vcxproj +387 -0
  71. package/vendor/raylib/projects/VS2022/examples/core_scissor_test.vcxproj +387 -0
  72. package/vendor/raylib/projects/VS2022/examples/core_split_screen.vcxproj +387 -0
  73. package/vendor/raylib/projects/VS2022/examples/core_storage_values.vcxproj +387 -0
  74. package/vendor/raylib/projects/VS2022/examples/core_vr_simulator.vcxproj +387 -0
  75. package/vendor/raylib/projects/VS2022/examples/core_window_flags.vcxproj +387 -0
  76. package/vendor/raylib/projects/VS2022/examples/core_window_letterbox.vcxproj +387 -0
  77. package/vendor/raylib/projects/VS2022/examples/core_window_should_close.vcxproj +390 -0
  78. package/vendor/raylib/projects/VS2022/examples/core_world_screen.vcxproj +387 -0
  79. package/vendor/raylib/projects/VS2022/examples/easings_testbed.vcxproj +387 -0
  80. package/vendor/raylib/projects/VS2022/examples/embedded_files_loading.vcxproj +387 -0
  81. package/vendor/raylib/projects/VS2022/examples/models_animation.vcxproj +387 -0
  82. package/vendor/raylib/projects/VS2022/examples/models_billboard.vcxproj +387 -0
  83. package/vendor/raylib/projects/VS2022/examples/models_box_collisions.vcxproj +387 -0
  84. package/vendor/raylib/projects/VS2022/examples/models_cubicmap.vcxproj +387 -0
  85. package/vendor/raylib/projects/VS2022/examples/models_first_person_maze.vcxproj +387 -0
  86. package/vendor/raylib/projects/VS2022/examples/models_geometric_shapes.vcxproj +387 -0
  87. package/vendor/raylib/projects/VS2022/examples/models_heightmap.vcxproj +387 -0
  88. package/vendor/raylib/projects/VS2022/examples/models_loading.vcxproj +387 -0
  89. package/vendor/raylib/projects/VS2022/examples/models_loading_gltf.vcxproj +387 -0
  90. package/vendor/raylib/projects/VS2022/examples/models_loading_vox.vcxproj +387 -0
  91. package/vendor/raylib/projects/VS2022/examples/models_mesh_generation.vcxproj +387 -0
  92. package/vendor/raylib/projects/VS2022/examples/models_mesh_picking.vcxproj +387 -0
  93. package/vendor/raylib/projects/VS2022/examples/models_orthographic_projection.vcxproj +387 -0
  94. package/vendor/raylib/projects/VS2022/examples/models_rlgl_solar_system.vcxproj +387 -0
  95. package/vendor/raylib/projects/VS2022/examples/models_skybox.vcxproj +387 -0
  96. package/vendor/raylib/projects/VS2022/examples/models_waving_cubes.vcxproj +387 -0
  97. package/vendor/raylib/projects/VS2022/examples/models_yaw_pitch_roll.vcxproj +387 -0
  98. package/vendor/raylib/projects/VS2022/examples/rlgl_compute_shaders.vcxproj +391 -0
  99. package/vendor/raylib/projects/VS2022/examples/rlgl_standalone.vcxproj +391 -0
  100. package/vendor/raylib/projects/VS2022/examples/shaders_basic_lighting.vcxproj +387 -0
  101. package/vendor/raylib/projects/VS2022/examples/shaders_custom_uniform.vcxproj +387 -0
  102. package/vendor/raylib/projects/VS2022/examples/shaders_eratosthenes.vcxproj +387 -0
  103. package/vendor/raylib/projects/VS2022/examples/shaders_fog.vcxproj +387 -0
  104. package/vendor/raylib/projects/VS2022/examples/shaders_hot_reloading.vcxproj +387 -0
  105. package/vendor/raylib/projects/VS2022/examples/shaders_julia_set.vcxproj +387 -0
  106. package/vendor/raylib/projects/VS2022/examples/shaders_mesh_instancing.vcxproj +387 -0
  107. package/vendor/raylib/projects/VS2022/examples/shaders_model_shader.vcxproj +387 -0
  108. package/vendor/raylib/projects/VS2022/examples/shaders_multi_sample2d.vcxproj +387 -0
  109. package/vendor/raylib/projects/VS2022/examples/shaders_palette_switch.vcxproj +387 -0
  110. package/vendor/raylib/projects/VS2022/examples/shaders_postprocessing.vcxproj +387 -0
  111. package/vendor/raylib/projects/VS2022/examples/shaders_raymarching.vcxproj +387 -0
  112. package/vendor/raylib/projects/VS2022/examples/shaders_shapes_textures.vcxproj +387 -0
  113. package/vendor/raylib/projects/VS2022/examples/shaders_simple_mask.vcxproj +387 -0
  114. package/vendor/raylib/projects/VS2022/examples/shaders_spotlight.vcxproj +387 -0
  115. package/vendor/raylib/projects/VS2022/examples/shaders_texture_drawing.vcxproj +387 -0
  116. package/vendor/raylib/projects/VS2022/examples/shaders_texture_waves.vcxproj +387 -0
  117. package/vendor/raylib/projects/VS2022/examples/shapes_basic_shapes.vcxproj +387 -0
  118. package/vendor/raylib/projects/VS2022/examples/shapes_bouncing_ball.vcxproj +387 -0
  119. package/vendor/raylib/projects/VS2022/examples/shapes_collision_area.vcxproj +387 -0
  120. package/vendor/raylib/projects/VS2022/examples/shapes_colors_palette.vcxproj +387 -0
  121. package/vendor/raylib/projects/VS2022/examples/shapes_draw_circle_sector.vcxproj +387 -0
  122. package/vendor/raylib/projects/VS2022/examples/shapes_draw_rectangle_rounded.vcxproj +387 -0
  123. package/vendor/raylib/projects/VS2022/examples/shapes_draw_ring.vcxproj +387 -0
  124. package/vendor/raylib/projects/VS2022/examples/shapes_easings_ball_anim.vcxproj +387 -0
  125. package/vendor/raylib/projects/VS2022/examples/shapes_easings_box_anim.vcxproj +387 -0
  126. package/vendor/raylib/projects/VS2022/examples/shapes_easings_rectangle_array.vcxproj +387 -0
  127. package/vendor/raylib/projects/VS2022/examples/shapes_following_eyes.vcxproj +387 -0
  128. package/vendor/raylib/projects/VS2022/examples/shapes_lines_bezier.vcxproj +387 -0
  129. package/vendor/raylib/projects/VS2022/examples/shapes_logo_raylib.vcxproj +387 -0
  130. package/vendor/raylib/projects/VS2022/examples/shapes_logo_raylib_anim.vcxproj +387 -0
  131. package/vendor/raylib/projects/VS2022/examples/shapes_rectangle_scaling.vcxproj +387 -0
  132. package/vendor/raylib/projects/VS2022/examples/text_codepoints_loading.vcxproj +387 -0
  133. package/vendor/raylib/projects/VS2022/examples/text_draw_3d.vcxproj +387 -0
  134. package/vendor/raylib/projects/VS2022/examples/text_font_filters.vcxproj +387 -0
  135. package/vendor/raylib/projects/VS2022/examples/text_font_loading.vcxproj +387 -0
  136. package/vendor/raylib/projects/VS2022/examples/text_font_sdf.vcxproj +387 -0
  137. package/vendor/raylib/projects/VS2022/examples/text_font_spritefont.vcxproj +387 -0
  138. package/vendor/raylib/projects/VS2022/examples/text_format_text.vcxproj +387 -0
  139. package/vendor/raylib/projects/VS2022/examples/text_input_box.vcxproj +387 -0
  140. package/vendor/raylib/projects/VS2022/examples/text_raylib_fonts.vcxproj +387 -0
  141. package/vendor/raylib/projects/VS2022/examples/text_rectangle_bounds.vcxproj +387 -0
  142. package/vendor/raylib/projects/VS2022/examples/text_unicode.vcxproj +387 -0
  143. package/vendor/raylib/projects/VS2022/examples/text_writing_anim.vcxproj +387 -0
  144. package/vendor/raylib/projects/VS2022/examples/textures_background_scrolling.vcxproj +387 -0
  145. package/vendor/raylib/projects/VS2022/examples/textures_blend_modes.vcxproj +387 -0
  146. package/vendor/raylib/projects/VS2022/examples/textures_bunnymark.vcxproj +387 -0
  147. package/vendor/raylib/projects/VS2022/examples/textures_draw_tiled.vcxproj +387 -0
  148. package/vendor/raylib/projects/VS2022/examples/textures_fog_of_war.vcxproj +387 -0
  149. package/vendor/raylib/projects/VS2022/examples/textures_gif_player.vcxproj +387 -0
  150. package/vendor/raylib/projects/VS2022/examples/textures_image_drawing.vcxproj +387 -0
  151. package/vendor/raylib/projects/VS2022/examples/textures_image_generation.vcxproj +387 -0
  152. package/vendor/raylib/projects/VS2022/examples/textures_image_loading.vcxproj +387 -0
  153. package/vendor/raylib/projects/VS2022/examples/textures_image_processing.vcxproj +387 -0
  154. package/vendor/raylib/projects/VS2022/examples/textures_image_text.vcxproj +387 -0
  155. package/vendor/raylib/projects/VS2022/examples/textures_logo_raylib.vcxproj +387 -0
  156. package/vendor/raylib/projects/VS2022/examples/textures_mouse_painting.vcxproj +387 -0
  157. package/vendor/raylib/projects/VS2022/examples/textures_npatch_drawing.vcxproj +387 -0
  158. package/vendor/raylib/projects/VS2022/examples/textures_particles_blending.vcxproj +387 -0
  159. package/vendor/raylib/projects/VS2022/examples/textures_polygon.vcxproj +387 -0
  160. package/vendor/raylib/projects/VS2022/examples/textures_raw_data.vcxproj +387 -0
  161. package/vendor/raylib/projects/VS2022/examples/textures_sprite_anim.vcxproj +387 -0
  162. package/vendor/raylib/projects/VS2022/examples/textures_sprite_button.vcxproj +387 -0
  163. package/vendor/raylib/projects/VS2022/examples/textures_sprite_explosion.vcxproj +387 -0
  164. package/vendor/raylib/projects/VS2022/examples/textures_srcrec_dstrec.vcxproj +387 -0
  165. package/vendor/raylib/projects/VS2022/examples/textures_to_image.vcxproj +387 -0
  166. package/vendor/raylib/projects/VS2022/raylib/raylib.vcxproj +340 -0
  167. package/vendor/raylib/projects/VS2022/raylib.sln +2347 -0
  168. package/build/qemu/2.1.0-beta.3/koffi_darwin_arm64.tar.gz +0 -0
  169. package/build/qemu/2.1.0-beta.3/koffi_darwin_x64.tar.gz +0 -0
  170. package/build/qemu/2.1.0-beta.3/koffi_freebsd_arm64.tar.gz +0 -0
  171. package/build/qemu/2.1.0-beta.3/koffi_freebsd_ia32.tar.gz +0 -0
  172. package/build/qemu/2.1.0-beta.3/koffi_freebsd_x64.tar.gz +0 -0
  173. package/build/qemu/2.1.0-beta.3/koffi_linux_arm32hf.tar.gz +0 -0
  174. package/build/qemu/2.1.0-beta.3/koffi_linux_arm64.tar.gz +0 -0
  175. package/build/qemu/2.1.0-beta.3/koffi_linux_ia32.tar.gz +0 -0
  176. package/build/qemu/2.1.0-beta.3/koffi_linux_riscv64hf64.tar.gz +0 -0
  177. package/build/qemu/2.1.0-beta.3/koffi_linux_x64.tar.gz +0 -0
  178. package/build/qemu/2.1.0-beta.3/koffi_openbsd_ia32.tar.gz +0 -0
  179. package/build/qemu/2.1.0-beta.3/koffi_openbsd_x64.tar.gz +0 -0
  180. package/build/qemu/2.1.0-beta.3/koffi_win32_arm64.tar.gz +0 -0
  181. package/build/qemu/2.1.0-beta.3/koffi_win32_ia32.tar.gz +0 -0
  182. package/build/qemu/2.1.0-beta.3/koffi_win32_x64.tar.gz +0 -0
  183. package/doc/dist/doctrees/benchmarks.doctree +0 -0
  184. package/doc/dist/doctrees/changes.doctree +0 -0
  185. package/doc/dist/doctrees/contribute.doctree +0 -0
  186. package/doc/dist/doctrees/environment.pickle +0 -0
  187. package/doc/dist/doctrees/functions.doctree +0 -0
  188. package/doc/dist/doctrees/index.doctree +0 -0
  189. package/doc/dist/doctrees/memory.doctree +0 -0
  190. package/doc/dist/doctrees/platforms.doctree +0 -0
  191. package/doc/dist/doctrees/start.doctree +0 -0
  192. package/doc/dist/doctrees/types.doctree +0 -0
  193. package/doc/dist/html/.buildinfo +0 -4
  194. package/doc/dist/html/_sources/benchmarks.md.txt +0 -137
  195. package/doc/dist/html/_sources/changes.md.txt +0 -161
  196. package/doc/dist/html/_sources/contribute.md.txt +0 -127
  197. package/doc/dist/html/_sources/functions.md.txt +0 -421
  198. package/doc/dist/html/_sources/index.rst.txt +0 -39
  199. package/doc/dist/html/_sources/memory.md.txt +0 -32
  200. package/doc/dist/html/_sources/platforms.md.txt +0 -31
  201. package/doc/dist/html/_sources/start.md.txt +0 -100
  202. package/doc/dist/html/_sources/types.md.txt +0 -541
  203. package/doc/dist/html/_static/_sphinx_javascript_frameworks_compat.js +0 -134
  204. package/doc/dist/html/_static/basic.css +0 -932
  205. package/doc/dist/html/_static/bench_linux.png +0 -0
  206. package/doc/dist/html/_static/bench_windows.png +0 -0
  207. package/doc/dist/html/_static/custom.css +0 -22
  208. package/doc/dist/html/_static/debug.css +0 -69
  209. package/doc/dist/html/_static/doctools.js +0 -264
  210. package/doc/dist/html/_static/documentation_options.js +0 -14
  211. package/doc/dist/html/_static/file.png +0 -0
  212. package/doc/dist/html/_static/jquery-3.6.0.js +0 -10881
  213. package/doc/dist/html/_static/jquery.js +0 -2
  214. package/doc/dist/html/_static/language_data.js +0 -199
  215. package/doc/dist/html/_static/minus.png +0 -0
  216. package/doc/dist/html/_static/perf_linux_20220623.png +0 -0
  217. package/doc/dist/html/_static/perf_linux_20220623_2.png +0 -0
  218. package/doc/dist/html/_static/perf_linux_20220627.png +0 -0
  219. package/doc/dist/html/_static/perf_linux_20220628.png +0 -0
  220. package/doc/dist/html/_static/perf_windows_20220623.png +0 -0
  221. package/doc/dist/html/_static/perf_windows_20220623_2.png +0 -0
  222. package/doc/dist/html/_static/perf_windows_20220627.png +0 -0
  223. package/doc/dist/html/_static/perf_windows_20220628.png +0 -0
  224. package/doc/dist/html/_static/plus.png +0 -0
  225. package/doc/dist/html/_static/pygments.css +0 -252
  226. package/doc/dist/html/_static/scripts/furo-extensions.js +0 -0
  227. package/doc/dist/html/_static/scripts/furo.js +0 -3
  228. package/doc/dist/html/_static/scripts/furo.js.LICENSE.txt +0 -7
  229. package/doc/dist/html/_static/scripts/furo.js.map +0 -1
  230. package/doc/dist/html/_static/searchtools.js +0 -531
  231. package/doc/dist/html/_static/skeleton.css +0 -296
  232. package/doc/dist/html/_static/styles/furo-extensions.css +0 -2
  233. package/doc/dist/html/_static/styles/furo-extensions.css.map +0 -1
  234. package/doc/dist/html/_static/styles/furo.css +0 -2
  235. package/doc/dist/html/_static/styles/furo.css.map +0 -1
  236. package/doc/dist/html/_static/underscore-1.13.1.js +0 -2042
  237. package/doc/dist/html/_static/underscore.js +0 -6
  238. package/doc/dist/html/benchmarks.html +0 -571
  239. package/doc/dist/html/changes.html +0 -686
  240. package/doc/dist/html/contribute.html +0 -403
  241. package/doc/dist/html/functions.html +0 -718
  242. package/doc/dist/html/genindex.html +0 -253
  243. package/doc/dist/html/index.html +0 -359
  244. package/doc/dist/html/memory.html +0 -346
  245. package/doc/dist/html/objects.inv +0 -0
  246. package/doc/dist/html/platforms.html +0 -371
  247. package/doc/dist/html/search.html +0 -261
  248. package/doc/dist/html/searchindex.js +0 -1
  249. package/doc/dist/html/start.html +0 -384
  250. package/doc/dist/html/types.html +0 -1061
@@ -144,7 +144,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
144
144
  #define PUSH_INTEGER(CType) \
145
145
  do { \
146
146
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
147
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1); \
147
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
148
148
  return false; \
149
149
  } \
150
150
  \
@@ -154,7 +154,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
154
154
  #define PUSH_INTEGER_SWAP(CType) \
155
155
  do { \
156
156
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
157
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1); \
157
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
158
158
  return false; \
159
159
  } \
160
160
  \
@@ -174,7 +174,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
174
174
 
175
175
  case PrimitiveKind::Bool: {
176
176
  if (RG_UNLIKELY(!value.IsBoolean())) {
177
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected boolean", GetValueType(instance, value), param.offset + 1);
177
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected boolean", GetValueType(instance, value));
178
178
  return false;
179
179
  }
180
180
 
@@ -198,44 +198,28 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
198
198
  case PrimitiveKind::UInt64S: { PUSH_INTEGER_SWAP(uint64_t); } break;
199
199
  case PrimitiveKind::String: {
200
200
  const char *str;
201
- if (RG_LIKELY(value.IsString())) {
202
- str = PushString(value);
203
- if (RG_UNLIKELY(!str))
204
- return false;
205
- } else if (IsNullOrUndefined(value)) {
206
- str = nullptr;
207
- } else {
208
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected string", GetValueType(instance, value), param.offset + 1);
201
+ if (RG_UNLIKELY(!PushString(value, &str)))
209
202
  return false;
210
- }
211
203
 
212
204
  *(const char **)(args_ptr++) = str;
213
205
  } break;
214
206
  case PrimitiveKind::String16: {
215
207
  const char16_t *str16;
216
- if (RG_LIKELY(value.IsString())) {
217
- str16 = PushString16(value);
218
- if (RG_UNLIKELY(!str16))
219
- return false;
220
- } else if (IsNullOrUndefined(value)) {
221
- str16 = nullptr;
222
- } else {
223
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected string", GetValueType(instance, value), param.offset + 1);
208
+ if (RG_UNLIKELY(!PushString16(value, &str16)))
224
209
  return false;
225
- }
226
210
 
227
211
  *(const char16_t **)(args_ptr++) = str16;
228
212
  } break;
229
213
  case PrimitiveKind::Pointer: {
230
214
  void *ptr;
231
- if (RG_UNLIKELY(!PushPointer(value, param, &ptr)))
215
+ if (RG_UNLIKELY(!PushPointer(value, param.type, param.directions, &ptr)))
232
216
  return false;
233
217
 
234
218
  *(void **)(args_ptr++) = ptr;
235
219
  } break;
236
220
  case PrimitiveKind::Record: {
237
221
  if (RG_UNLIKELY(!IsObject(value))) {
238
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected object", GetValueType(instance, value), param.offset + 1);
222
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected object", GetValueType(instance, value));
239
223
  return false;
240
224
  }
241
225
 
@@ -254,7 +238,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
254
238
  case PrimitiveKind::Array: { RG_UNREACHABLE(); } break;
255
239
  case PrimitiveKind::Float32: {
256
240
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
257
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1);
241
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
258
242
  return false;
259
243
  }
260
244
 
@@ -265,7 +249,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
265
249
  } break;
266
250
  case PrimitiveKind::Float64: {
267
251
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
268
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1);
252
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
269
253
  return false;
270
254
  }
271
255
 
@@ -286,7 +270,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
286
270
  } else if (IsNullOrUndefined(value)) {
287
271
  ptr = nullptr;
288
272
  } else {
289
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected %3", GetValueType(instance, value), param.offset + 1, param.type->name);
273
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected %2", GetValueType(instance, value), param.type->name);
290
274
  return false;
291
275
  }
292
276
 
@@ -632,7 +616,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
632
616
  #define RETURN_INTEGER(CType) \
633
617
  do { \
634
618
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
635
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value)); \
619
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
636
620
  return; \
637
621
  } \
638
622
  \
@@ -642,7 +626,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
642
626
  #define RETURN_INTEGER_SWAP(CType) \
643
627
  do { \
644
628
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
645
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value)); \
629
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
646
630
  return; \
647
631
  } \
648
632
  \
@@ -654,7 +638,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
654
638
  case PrimitiveKind::Void: {} break;
655
639
  case PrimitiveKind::Bool: {
656
640
  if (RG_UNLIKELY(!value.IsBoolean())) {
657
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected boolean", GetValueType(instance, value));
641
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected boolean", GetValueType(instance, value));
658
642
  return;
659
643
  }
660
644
 
@@ -677,31 +661,15 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
677
661
  case PrimitiveKind::UInt64S: { RETURN_INTEGER_SWAP(uint64_t); } break;
678
662
  case PrimitiveKind::String: {
679
663
  const char *str;
680
- if (RG_LIKELY(value.IsString())) {
681
- str = PushString(value);
682
- if (RG_UNLIKELY(!str))
683
- return;
684
- } else if (IsNullOrUndefined(value)) {
685
- str = nullptr;
686
- } else {
687
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected string", GetValueType(instance, value));
664
+ if (RG_UNLIKELY(!PushString(value, &str)))
688
665
  return;
689
- }
690
666
 
691
667
  out_reg->rax = (uint64_t)str;
692
668
  } break;
693
669
  case PrimitiveKind::String16: {
694
670
  const char16_t *str16;
695
- if (RG_LIKELY(value.IsString())) {
696
- str16 = PushString16(value);
697
- if (RG_UNLIKELY(!str16))
698
- return;
699
- } else if (IsNullOrUndefined(value)) {
700
- str16 = nullptr;
701
- } else {
702
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected string", GetValueType(instance, value));
671
+ if (RG_UNLIKELY(!PushString16(value, &str16)))
703
672
  return;
704
- }
705
673
 
706
674
  out_reg->rax = (uint64_t)str16;
707
675
  } break;
@@ -720,7 +688,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
720
688
  } else if (IsNullOrUndefined(value)) {
721
689
  ptr = nullptr;
722
690
  } else {
723
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected %2", GetValueType(instance, value), type->name);
691
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected %2", GetValueType(instance, value), type->name);
724
692
  return;
725
693
  }
726
694
 
@@ -728,7 +696,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
728
696
  } break;
729
697
  case PrimitiveKind::Record: {
730
698
  if (RG_UNLIKELY(!IsObject(value))) {
731
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected object", GetValueType(instance, value));
699
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected object", GetValueType(instance, value));
732
700
  return;
733
701
  }
734
702
 
@@ -745,7 +713,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
745
713
  case PrimitiveKind::Array: { RG_UNREACHABLE(); } break;
746
714
  case PrimitiveKind::Float32: {
747
715
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
748
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value));
716
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
749
717
  return;
750
718
  }
751
719
 
@@ -756,7 +724,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
756
724
  } break;
757
725
  case PrimitiveKind::Float64: {
758
726
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
759
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value));
727
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
760
728
  return;
761
729
  }
762
730
 
@@ -777,7 +745,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
777
745
  } else if (IsNullOrUndefined(value)) {
778
746
  ptr = nullptr;
779
747
  } else {
780
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected %2", GetValueType(instance, value), type->name);
748
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected %2", GetValueType(instance, value), type->name);
781
749
  return;
782
750
  }
783
751
 
package/src/abi_x86.cc CHANGED
@@ -200,7 +200,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
200
200
  #define PUSH_INTEGER_32(CType) \
201
201
  do { \
202
202
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
203
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1); \
203
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
204
204
  return false; \
205
205
  } \
206
206
  \
@@ -210,7 +210,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
210
210
  #define PUSH_INTEGER_32_SWAP(CType) \
211
211
  do { \
212
212
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
213
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1); \
213
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
214
214
  return false; \
215
215
  } \
216
216
  \
@@ -220,7 +220,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
220
220
  #define PUSH_INTEGER_64(CType) \
221
221
  do { \
222
222
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
223
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1); \
223
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
224
224
  return false; \
225
225
  } \
226
226
  \
@@ -232,7 +232,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
232
232
  #define PUSH_INTEGER_64_SWAP(CType) \
233
233
  do { \
234
234
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
235
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1); \
235
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
236
236
  return false; \
237
237
  } \
238
238
  \
@@ -254,7 +254,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
254
254
 
255
255
  case PrimitiveKind::Bool: {
256
256
  if (RG_UNLIKELY(!value.IsBoolean())) {
257
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected boolean", GetValueType(instance, value), param.offset + 1);
257
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected boolean", GetValueType(instance, value));
258
258
  return false;
259
259
  }
260
260
 
@@ -277,44 +277,28 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
277
277
  case PrimitiveKind::UInt64S: { PUSH_INTEGER_64_SWAP(uint64_t); } break;
278
278
  case PrimitiveKind::String: {
279
279
  const char *str;
280
- if (RG_LIKELY(value.IsString())) {
281
- str = PushString(value);
282
- if (RG_UNLIKELY(!str))
283
- return false;
284
- } else if (IsNullOrUndefined(value)) {
285
- str = nullptr;
286
- } else {
287
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected string", GetValueType(instance, value), param.offset + 1);
280
+ if (RG_UNLIKELY(!PushString(value, &str)))
288
281
  return false;
289
- }
290
282
 
291
283
  *(const char **)((param.fast ? fast_ptr : args_ptr)++) = str;
292
284
  } break;
293
285
  case PrimitiveKind::String16: {
294
286
  const char16_t *str16;
295
- if (RG_LIKELY(value.IsString())) {
296
- str16 = PushString16(value);
297
- if (RG_UNLIKELY(!str16))
298
- return false;
299
- } else if (IsNullOrUndefined(value)) {
300
- str16 = nullptr;
301
- } else {
302
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected string", GetValueType(instance, value), param.offset + 1);
287
+ if (RG_UNLIKELY(!PushString16(value, &str16)))
303
288
  return false;
304
- }
305
289
 
306
290
  *(const char16_t **)((param.fast ? fast_ptr : args_ptr)++) = str16;
307
291
  } break;
308
292
  case PrimitiveKind::Pointer: {
309
293
  void *ptr;
310
- if (RG_UNLIKELY(!PushPointer(value, param, &ptr)))
294
+ if (RG_UNLIKELY(!PushPointer(value, param.type, param.directions, &ptr)))
311
295
  return false;
312
296
 
313
297
  *(void **)((param.fast ? fast_ptr : args_ptr)++) = ptr;
314
298
  } break;
315
299
  case PrimitiveKind::Record: {
316
300
  if (RG_UNLIKELY(!IsObject(value))) {
317
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected object", GetValueType(instance, value), param.offset + 1);
301
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected object", GetValueType(instance, value));
318
302
  return false;
319
303
  }
320
304
 
@@ -334,7 +318,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
334
318
  case PrimitiveKind::Array: { RG_UNREACHABLE(); } break;
335
319
  case PrimitiveKind::Float32: {
336
320
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
337
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1);
321
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
338
322
  return false;
339
323
  }
340
324
 
@@ -343,7 +327,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
343
327
  } break;
344
328
  case PrimitiveKind::Float64: {
345
329
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
346
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected number", GetValueType(instance, value), param.offset + 1);
330
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
347
331
  return false;
348
332
  }
349
333
 
@@ -365,7 +349,7 @@ bool CallData::Prepare(const Napi::CallbackInfo &info)
365
349
  } else if (IsNullOrUndefined(value)) {
366
350
  ptr = nullptr;
367
351
  } else {
368
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for argument %2, expected %3", GetValueType(instance, value), param.offset + 1, param.type->name);
352
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected %2", GetValueType(instance, value), param.type->name);
369
353
  return false;
370
354
  }
371
355
 
@@ -711,7 +695,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
711
695
  #define RETURN_INTEGER_32(CType) \
712
696
  do { \
713
697
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
714
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value)); \
698
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
715
699
  return; \
716
700
  } \
717
701
  \
@@ -721,7 +705,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
721
705
  #define RETURN_INTEGER_32_SWAP(CType) \
722
706
  do { \
723
707
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
724
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value)); \
708
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
725
709
  return; \
726
710
  } \
727
711
  \
@@ -731,7 +715,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
731
715
  #define RETURN_INTEGER_64(CType) \
732
716
  do { \
733
717
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
734
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value)); \
718
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
735
719
  return; \
736
720
  } \
737
721
  \
@@ -743,7 +727,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
743
727
  #define RETURN_INTEGER_64_SWAP(CType) \
744
728
  do { \
745
729
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) { \
746
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value)); \
730
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value)); \
747
731
  return; \
748
732
  } \
749
733
  \
@@ -757,7 +741,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
757
741
  case PrimitiveKind::Void: {} break;
758
742
  case PrimitiveKind::Bool: {
759
743
  if (RG_UNLIKELY(!value.IsBoolean())) {
760
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected boolean", GetValueType(instance, value));
744
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected boolean", GetValueType(instance, value));
761
745
  return;
762
746
  }
763
747
 
@@ -780,31 +764,15 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
780
764
  case PrimitiveKind::UInt64S: { RETURN_INTEGER_64_SWAP(uint64_t); } break;
781
765
  case PrimitiveKind::String: {
782
766
  const char *str;
783
- if (RG_LIKELY(value.IsString())) {
784
- str = PushString(value);
785
- if (RG_UNLIKELY(!str))
786
- return;
787
- } else if (IsNullOrUndefined(value)) {
788
- str = nullptr;
789
- } else {
790
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected string", GetValueType(instance, value));
767
+ if (RG_UNLIKELY(!PushString(value, &str)))
791
768
  return;
792
- }
793
769
 
794
770
  out_reg->eax = (uint32_t)str;
795
771
  } break;
796
772
  case PrimitiveKind::String16: {
797
773
  const char16_t *str16;
798
- if (RG_LIKELY(value.IsString())) {
799
- str16 = PushString16(value);
800
- if (RG_UNLIKELY(!str16))
801
- return;
802
- } else if (IsNullOrUndefined(value)) {
803
- str16 = nullptr;
804
- } else {
805
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected string", GetValueType(instance, value));
774
+ if (RG_UNLIKELY(!PushString16(value, &str16)))
806
775
  return;
807
- }
808
776
 
809
777
  out_reg->eax = (uint32_t)str16;
810
778
  } break;
@@ -823,7 +791,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
823
791
  } else if (IsNullOrUndefined(value)) {
824
792
  ptr = nullptr;
825
793
  } else {
826
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected %2", GetValueType(instance, value), type->name);
794
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected %2", GetValueType(instance, value), type->name);
827
795
  return;
828
796
  }
829
797
 
@@ -831,7 +799,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
831
799
  } break;
832
800
  case PrimitiveKind::Record: {
833
801
  if (RG_UNLIKELY(!IsObject(value))) {
834
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected object", GetValueType(instance, value));
802
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected object", GetValueType(instance, value));
835
803
  return;
836
804
  }
837
805
 
@@ -848,7 +816,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
848
816
  case PrimitiveKind::Array: { RG_UNREACHABLE(); } break;
849
817
  case PrimitiveKind::Float32: {
850
818
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
851
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value));
819
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
852
820
  return;
853
821
  }
854
822
 
@@ -857,7 +825,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
857
825
  } break;
858
826
  case PrimitiveKind::Float64: {
859
827
  if (RG_UNLIKELY(!value.IsNumber() && !value.IsBigInt())) {
860
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected number", GetValueType(instance, value));
828
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected number", GetValueType(instance, value));
861
829
  return;
862
830
  }
863
831
 
@@ -878,7 +846,7 @@ void CallData::Relay(Size idx, uint8_t *own_sp, uint8_t *caller_sp, BackRegister
878
846
  } else if (IsNullOrUndefined(value)) {
879
847
  ptr = nullptr;
880
848
  } else {
881
- ThrowError<Napi::TypeError>(env, "Unexpected %1 value for return value, expected %2", GetValueType(instance, value), type->name);
849
+ ThrowError<Napi::TypeError>(env, "Unexpected %1 value, expected %2", GetValueType(instance, value), type->name);
882
850
  return;
883
851
  }
884
852