@auto_js/v8_exports 0.0.5 → 0.0.7

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
@@ -98,7 +98,7 @@ if(NPM_PACKAGE_NAME STREQUAL @auto_js/isolated_v8_exports)
98
98
  # target_link_libraries(google_v8 PRIVATE atomic)
99
99
  # endif()
100
100
  elseif(V8_LIBRARY_TYPE STREQUAL shared)
101
- target_link_directories(${google_v8} PRIVATE "${V8_LIBRARY_PATH}")
101
+ target_link_directories(${google_v8} PUBLIC "${V8_LIBRARY_PATH}")
102
102
  target_link_libraries(${google_v8} PRIVATE v8 v8_libbase v8_libplatform icuuc)
103
103
  else()
104
104
  message(FATAL_ERROR "Unknown v8 library type")
@@ -114,6 +114,9 @@ else()
114
114
  message(FATAL_ERROR "Missing '${V8_INCLUDE_DIR}/v8.h'")
115
115
  endif()
116
116
  message(STATUS "Using v8 headers from '${V8_INCLUDE_DIR}'")
117
+
118
+ # nodejs v8 is linked as a shared library
119
+ target_compile_definitions(${google_v8} PRIVATE USING_V8_SHARED)
117
120
  endif()
118
121
 
119
122
  # These need to be public, for version detection. I was hoping I could do it with constexpr but
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auto_js/v8_exports",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "C++ module exports for v8",
5
5
  "author": "https://github.com/laverdet/",
6
6
  "homepage": "https://github.com/laverdet/isolated-vm/tree/experimental/packages/third_party/v8",
package/v8.cc CHANGED
@@ -1,6 +1,16 @@
1
1
  module;
2
+ // Pull in `V8_EXPORT`
3
+ #include "v8config.h"
4
+
5
+ // Redefine `V8_EXPORT` with weak attribute
6
+ #if USING_V8_SHARED
7
+ #undef V8_EXPORT
8
+ #include "v8_js/extern.h"
9
+ #endif
10
+
11
+ // Continue with the rest of the include chain
2
12
  #include "v8.h"
3
- #include "v8/version.h"
13
+ #include "v8_js/version.h"
4
14
  #ifdef INCLUDE_V8_PLATFORM
5
15
  #include "libplatform/libplatform.h"
6
16
  #include "v8-platform.h"
@@ -17,6 +27,51 @@ using v8::BackingStore;
17
27
  using v8::DataView;
18
28
  using v8::SharedArrayBuffer;
19
29
 
30
+ // v8-callback.h
31
+ using v8::AccessType;
32
+ using v8::AddCrashKeyCallback;
33
+ using v8::AddHistogramSampleCallback;
34
+ using v8::AllowWasmCodeGenerationCallback;
35
+ using v8::ApiImplementationCallback;
36
+ using v8::BeforeCallEnteredCallback;
37
+ using v8::CallCompletedCallback;
38
+ using v8::CompileHintCallback;
39
+ using v8::CounterLookupCallback;
40
+ using v8::CrashKeyId;
41
+ using v8::CreateHistogramCallback;
42
+ using v8::ExtensionCallback;
43
+ using v8::FailedAccessCheckCallback;
44
+ using v8::FatalErrorCallback;
45
+ using v8::GCCallback;
46
+ using v8::GCCallbackFlags;
47
+ using v8::GCType;
48
+ using v8::HostCreateShadowRealmContextCallback;
49
+ using v8::HostImportModuleDynamicallyCallback;
50
+ using v8::HostImportModuleWithPhaseDynamicallyCallback;
51
+ using v8::HostInitializeImportMetaObjectCallback;
52
+ using v8::InterruptCallback;
53
+ using v8::IsJSApiWrapperNativeErrorCallback;
54
+ using v8::JitCodeEvent;
55
+ using v8::JitCodeEventHandler;
56
+ using v8::JitCodeEventOptions;
57
+ using v8::LogEventCallback;
58
+ using v8::LogEventStatus;
59
+ using v8::MessageCallback;
60
+ using v8::ModifyCodeGenerationFromStringsCallback;
61
+ using v8::ModifyCodeGenerationFromStringsCallback2;
62
+ using v8::ModifyCodeGenerationFromStringsResult;
63
+ using v8::ModuleImportPhase;
64
+ using v8::NearHeapLimitCallback;
65
+ using v8::OOMDetails;
66
+ using v8::OOMErrorCallback;
67
+ using v8::PrepareStackTraceCallback;
68
+ using v8::PrintCurrentStackTraceFilterCallback;
69
+ using v8::SharedArrayBufferConstructorEnabledCallback;
70
+ using v8::WasmAsyncResolvePromiseCallback;
71
+ using v8::WasmAsyncSuccess;
72
+ using v8::WasmLoadSourceMapCallback;
73
+ using v8::WasmStreamingCallback;
74
+
20
75
  // v8-container.h
21
76
  using v8::Array;
22
77
 
@@ -50,6 +105,16 @@ using v8::ReturnValue;
50
105
  // v8-function.h
51
106
  using v8::Function;
52
107
 
108
+ // v8-heap-statistics.h
109
+ using v8::HeapCodeStatistics;
110
+ using v8::HeapObjectStatistics;
111
+ using v8::HeapSpaceStatistics;
112
+ using v8::HeapStatistics;
113
+ using v8::MeasureMemoryDelegate;
114
+ using v8::MeasureMemoryExecution;
115
+ using v8::MeasureMemoryMode;
116
+ using v8::SharedMemoryStatistics;
117
+
53
118
  // v8-initialization.h
54
119
  using v8::DcheckErrorCallback;
55
120
  using v8::EntropySource;
@@ -61,6 +126,9 @@ using v8::V8FatalErrorCallback;
61
126
 
62
127
  // v8-isolate.h
63
128
  using v8::Isolate;
129
+ using v8::IsolateGroup;
130
+ using v8::MemoryPressureLevel;
131
+ using v8::ResourceConstraints;
64
132
 
65
133
  // v8-local-handle.h
66
134
  using v8::EscapableHandleScope;
package/v8_js/extern.h ADDED
@@ -0,0 +1,9 @@
1
+ #if __linux__
2
+ #define V8_EXPORT __attribute__((weak))
3
+ #elif __APPLE__
4
+ #define V8_EXPORT __attribute__((weak))
5
+ #elif _WIN64
6
+ #define V8_EXPORT __declspec(dllimport) __attribute__((weak))
7
+ #else
8
+ #define V8_EXPORT
9
+ #endif
File without changes