@auto_js/napi_exports 0.0.8 → 0.0.9

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 CHANGED
@@ -5,10 +5,11 @@ target_compile_features(nodejs PUBLIC cxx_std_23)
5
5
  if(NOT DEFINED NAPI_VERSION)
6
6
  message(FATAL_ERROR "Missing 'NAPI_VERSION' cmake variable.")
7
7
  elseif(NAPI_VERSION STREQUAL EXPERIMENTAL)
8
- target_compile_definitions(nodejs PUBLIC NAPI_EXPERIMENTAL)
8
+ target_compile_definitions(nodejs PUBLIC NODE_API_EXPERIMENTAL_NO_WARNING NAPI_EXPERIMENTAL)
9
9
  else()
10
10
  target_compile_definitions(nodejs PUBLIC NAPI_VERSION=${NAPI_VERSION})
11
11
  endif()
12
+ target_compile_options(nodejs PRIVATE "-Wno-#warnings")
12
13
 
13
14
  # Architecture, for window linkage
14
15
  string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} NODE_ARCH)
package/js_native_api.cc CHANGED
@@ -3,8 +3,12 @@ module;
3
3
  // https://nodejs.org/api/n-api.html
4
4
  #include <js_native_api.h>
5
5
  export module nodejs:js_native_api;
6
+ import std;
6
7
  // NOLINTBEGIN(misc-unused-using-decls)
7
8
 
9
+ template <class Result, class... Params>
10
+ constexpr auto unimplemented = [](Params...) -> Result { std::terminate(); };
11
+
8
12
  export using ::napi_add_finalizer;
9
13
  export using ::napi_call_function;
10
14
  export using ::napi_check_object_type_tag;
@@ -93,12 +97,22 @@ export using ::napi_type_tag_object;
93
97
  export using ::napi_typeof;
94
98
  export using ::napi_unwrap;
95
99
  export using ::napi_wrap;
100
+ #ifdef NODE_API_EXPERIMENTAL_HAS_CREATE_EXTERNAL_SHAREDARRAYBUFFER
96
101
  export using ::node_api_create_external_sharedarraybuffer;
102
+ #endif
97
103
  export using ::node_api_create_property_key_latin1;
98
104
  export using ::node_api_create_property_key_utf16;
99
105
  export using ::node_api_create_property_key_utf8;
100
106
  export using ::node_api_create_syntax_error;
107
+ #ifdef NODE_API_EXPERIMENTAL_HAS_SHAREDARRAYBUFFER
108
+ export constexpr auto node_api_has_sharedarraybuffer = true;
101
109
  export using ::node_api_is_sharedarraybuffer;
110
+ #else
111
+ export constexpr auto node_api_has_sharedarraybuffer = false;
112
+ export auto node_api_is_sharedarraybuffer(napi_env, napi_value, bool*) -> napi_status {
113
+ std::terminate();
114
+ };
115
+ #endif
102
116
  export using ::node_api_throw_syntax_error;
103
117
 
104
118
  // NOLINTEND(misc-unused-using-decls)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auto_js/napi_exports",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "C++ module exports for nodejs & n-api",
5
5
  "author": "https://github.com/laverdet/",
6
6
  "homepage": "https://github.com/laverdet/isolated-vm/tree/experimental/packages/third_party/nodejs",