@nocobase/plugin-workflow-javascript 2.1.0-beta.23 → 2.1.0-beta.25

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 (45) hide show
  1. package/dist/externalVersion.js +4 -4
  2. package/dist/node_modules/isolated-vm/Dockerfile.alpine +2 -2
  3. package/dist/node_modules/isolated-vm/Dockerfile.debian +1 -1
  4. package/dist/node_modules/isolated-vm/binding.gyp +16 -16
  5. package/dist/node_modules/isolated-vm/isolated-vm-6.1.2.tgz +0 -0
  6. package/dist/node_modules/isolated-vm/isolated-vm.js +1 -1
  7. package/dist/node_modules/isolated-vm/package.json +1 -1
  8. package/dist/node_modules/isolated-vm/prebuilds/darwin-arm64/isolated-vm.abi127.node +0 -0
  9. package/dist/node_modules/isolated-vm/prebuilds/darwin-arm64/isolated-vm.abi137.node +0 -0
  10. package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi127.glibc.node +0 -0
  11. package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi127.musl.node +0 -0
  12. package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi137.glibc.node +0 -0
  13. package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi137.musl.node +0 -0
  14. package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi127.glibc.node +0 -0
  15. package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi127.musl.node +0 -0
  16. package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi137.glibc.node +0 -0
  17. package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi137.musl.node +0 -0
  18. package/dist/node_modules/isolated-vm/prebuilds/win32-x64/isolated-vm.abi127.node +0 -0
  19. package/dist/node_modules/isolated-vm/prebuilds/win32-x64/isolated-vm.abi137.node +0 -0
  20. package/dist/node_modules/isolated-vm/scripts/run-prebuild.js +33 -0
  21. package/dist/node_modules/isolated-vm/src/isolate/allocator.h +0 -2
  22. package/dist/node_modules/isolated-vm/src/isolate/allocator_nortti.cc +0 -11
  23. package/dist/node_modules/isolated-vm/src/isolate/class_handle.h +5 -1
  24. package/dist/node_modules/isolated-vm/src/isolate/environment.cc +1 -0
  25. package/dist/node_modules/isolated-vm/src/isolate/environment.h +1 -1
  26. package/dist/node_modules/isolated-vm/src/isolate/generic/callbacks.h +8 -16
  27. package/dist/node_modules/isolated-vm/src/isolate/holder.cc +2 -2
  28. package/dist/node_modules/isolated-vm/src/isolate/holder.h +9 -3
  29. package/dist/node_modules/isolated-vm/src/isolate/platform_delegate.h +4 -4
  30. package/dist/node_modules/isolated-vm/src/isolate/remote_handle.h +1 -1
  31. package/dist/node_modules/isolated-vm/src/isolate/stack_trace.cc +1 -2
  32. package/dist/node_modules/isolated-vm/src/isolate/stack_trace.h +1 -1
  33. package/dist/node_modules/isolated-vm/src/isolate/util.h +1 -1
  34. package/dist/node_modules/isolated-vm/src/isolate/v8_inspector_wrapper.h +3 -1
  35. package/dist/node_modules/isolated-vm/src/module/callback.cc +5 -1
  36. package/dist/node_modules/isolated-vm/src/module/evaluation.cc +0 -1
  37. package/dist/node_modules/isolated-vm/src/module/external_copy_handle.cc +7 -1
  38. package/dist/node_modules/isolated-vm/src/module/isolate_handle.cc +18 -6
  39. package/dist/node_modules/isolated-vm/src/module/native_module_handle.cc +5 -1
  40. package/dist/node_modules/isolated-vm/src/module/reference_handle.cc +5 -1
  41. package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v24.0.0.h +426 -0
  42. package/dist/node_modules/joi/package.json +1 -1
  43. package/dist/node_modules/winston-transport/package.json +1 -1
  44. package/package.json +3 -3
  45. package/dist/node_modules/isolated-vm/out/isolated_vm.node +0 -0
@@ -13,11 +13,11 @@ module.exports = {
13
13
  "antd-style": "3.7.1",
14
14
  "@formily/antd-v5": "1.2.3",
15
15
  "@ant-design/icons": "5.6.1",
16
- "@nocobase/client": "2.1.0-beta.23",
17
- "@nocobase/plugin-workflow": "2.1.0-beta.23",
16
+ "@nocobase/client": "2.1.0-beta.25",
17
+ "@nocobase/plugin-workflow": "2.1.0-beta.25",
18
18
  "antd": "5.24.2",
19
- "@nocobase/flow-engine": "2.1.0-beta.23",
19
+ "@nocobase/flow-engine": "2.1.0-beta.25",
20
20
  "react-i18next": "11.18.6",
21
21
  "winston": "3.13.0",
22
- "@nocobase/server": "2.1.0-beta.23"
22
+ "@nocobase/server": "2.1.0-beta.25"
23
23
  };
@@ -1,9 +1,9 @@
1
- FROM node:22-alpine3.20 AS build
1
+ FROM node:22-alpine3.23 AS build
2
2
  WORKDIR /isolated-vm
3
3
  RUN apk add g++ make python3
4
4
  COPY . .
5
5
  RUN npm install --ignore-scripts
6
- RUN MAKEFLAGS=-j$(nproc) npx -y prebuild
6
+ RUN npm run prebuild
7
7
 
8
8
  FROM scratch
9
9
  COPY --from=build /isolated-vm/prebuilds .
@@ -7,6 +7,6 @@ RUN apt-get update && \
7
7
  python3
8
8
  COPY . .
9
9
  RUN npm install --ignore-scripts
10
- RUN MAKEFLAGS=-j$(nproc) npx -y prebuild
10
+ RUN npm run prebuild
11
11
  FROM scratch
12
12
  COPY --from=build /isolated-vm/prebuilds .
@@ -3,18 +3,18 @@
3
3
  'default_configuration': 'Release',
4
4
  'configurations': {
5
5
  'Common': {
6
- 'cflags_cc': [ '-std=c++17', '-g', '-Wno-unknown-pragmas' ],
6
+ 'cflags_cc': [ '-std=c++20', '-g', '-Wno-unknown-pragmas' ],
7
7
  'cflags_cc!': [ '-fno-exceptions' ],
8
8
  'include_dirs': [ './src', './vendor' ],
9
9
  'xcode_settings': {
10
10
  'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
11
11
  'GCC_GENERATE_DEBUGGING_SYMBOLS': 'YES',
12
- 'CLANG_CXX_LANGUAGE_STANDARD': 'c++17',
12
+ 'CLANG_CXX_LANGUAGE_STANDARD': 'c++20',
13
13
  'MACOSX_DEPLOYMENT_TARGET': '10.12',
14
14
  },
15
15
  'msvs_settings': {
16
16
  'VCCLCompilerTool': {
17
- 'AdditionalOptions': [ '-std:c++17', '/GR' ],
17
+ 'AdditionalOptions': [ '-std:c++20' ],
18
18
  'ExceptionHandling': '1',
19
19
  },
20
20
  },
@@ -50,9 +50,18 @@
50
50
  'xcode_settings': {
51
51
  'GCC_ENABLE_CPP_RTTI': 'YES',
52
52
  },
53
- 'msvs_settings': {
54
- 'VCCLCompilerTool': {
55
- 'RuntimeTypeInfo': 'true',
53
+ # nb: For whatever reason this msvs setting cannot be inherited and must be directly set on
54
+ # each target
55
+ 'configurations': {
56
+ 'Debug': {
57
+ 'msvs_settings': {
58
+ 'VCCLCompilerTool': { 'RuntimeTypeInfo': 'true' },
59
+ },
60
+ },
61
+ 'Release': {
62
+ 'msvs_settings': {
63
+ 'VCCLCompilerTool': { 'RuntimeTypeInfo': 'true' },
64
+ },
56
65
  },
57
66
  },
58
67
  'conditions': [
@@ -65,7 +74,7 @@
65
74
  'src/external_copy/string.cc',
66
75
  'src/isolate/allocator_nortti.cc',
67
76
  'src/isolate/environment.cc',
68
- "src/isolate/cpu_profile_manager.cc",
77
+ 'src/isolate/cpu_profile_manager.cc',
69
78
  'src/isolate/executor.cc',
70
79
  'src/isolate/holder.cc',
71
80
  'src/isolate/inspector.cc',
@@ -107,14 +116,5 @@
107
116
  'src/isolate/allocator_nortti.cc',
108
117
  ],
109
118
  },
110
- {
111
- 'target_name': 'action_after_build',
112
- 'type': 'none',
113
- 'dependencies': [ 'isolated_vm' ],
114
- 'copies': [ {
115
- 'files': [ '<(PRODUCT_DIR)/isolated_vm.node' ],
116
- 'destination': 'out',
117
- } ],
118
- },
119
119
  ],
120
120
  }
@@ -1 +1 @@
1
- (()=>{var e={290:(e,r,_)=>{e.exports=_(794).ivm},794:(e,r,_)=>{e.exports=require(_.ab+"out/isolated_vm.node")}};var r={};function __nccwpck_require__(_){var a=r[_];if(a!==undefined){return a.exports}var i=r[_]={exports:{}};var t=true;try{e[_](i,i.exports,__nccwpck_require__);t=false}finally{if(t)delete r[_]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var _=__nccwpck_require__(290);module.exports=_})();
1
+ (()=>{var __webpack_modules__={290:(e,r,i)=>{e.exports=i(90)(__dirname).ivm},90:(module,__unused_webpack_exports,__nccwpck_require__)=>{const runtimeRequire=true?eval("require"):0;if(typeof runtimeRequire.addon==="function"){module.exports=runtimeRequire.addon.bind(runtimeRequire)}else{module.exports=__nccwpck_require__(403)}},403:(module,__unused_webpack_exports,__nccwpck_require__)=>{var fs=__nccwpck_require__(147);var path=__nccwpck_require__(17);var os=__nccwpck_require__(37);var runtimeRequire=true?eval("require"):0;var vars=process.config&&process.config.variables||{};var prebuildsOnly=!!process.env.PREBUILDS_ONLY;var abi=process.versions.modules;var runtime=isElectron()?"electron":isNwjs()?"node-webkit":"node";var arch=process.env.npm_config_arch||os.arch();var platform=process.env.npm_config_platform||os.platform();var libc=process.env.LIBC||(isAlpine(platform)?"musl":"glibc");var armv=process.env.ARM_VERSION||(arch==="arm64"?"8":vars.arm_version)||"";var uv=(process.versions.uv||"").split(".")[0];module.exports=load;function load(e){return runtimeRequire(load.resolve(e))}load.resolve=load.path=function(e){e=path.resolve(e||".");try{var r=runtimeRequire(path.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");if(process.env[r+"_PREBUILD"])e=process.env[r+"_PREBUILD"]}catch(e){}if(!prebuildsOnly){var i=getFirst(path.join(e,"build/Release"),matchBuild);if(i)return i;var a=getFirst(path.join(e,"build/Debug"),matchBuild);if(a)return a}var n=resolve(e);if(n)return n;var t=resolve(path.dirname(process.execPath));if(t)return t;var s=["platform="+platform,"arch="+arch,"runtime="+runtime,"abi="+abi,"uv="+uv,armv?"armv="+armv:"","libc="+libc,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",true?"webpack=true":0].filter(Boolean).join(" ");throw new Error("No native build was found for "+s+"\n loaded from: "+e+"\n");function resolve(e){var r=readdirSync(path.join(e,"prebuilds")).map(parseTuple);var i=r.filter(matchTuple(platform,arch)).sort(compareTuples)[0];if(!i)return;var a=path.join(e,"prebuilds",i.name);var n=readdirSync(a).map(parseTags);var t=n.filter(matchTags(runtime,abi));var s=t.sort(compareTags(runtime))[0];if(s)return path.join(a,s.file)}};function readdirSync(e){try{return fs.readdirSync(e)}catch(e){return[]}}function getFirst(e,r){var i=readdirSync(e).filter(r);return i[0]&&path.join(e,i[0])}function matchBuild(e){return/\.node$/.test(e)}function parseTuple(e){var r=e.split("-");if(r.length!==2)return;var i=r[0];var a=r[1].split("+");if(!i)return;if(!a.length)return;if(!a.every(Boolean))return;return{name:e,platform:i,architectures:a}}function matchTuple(e,r){return function(i){if(i==null)return false;if(i.platform!==e)return false;return i.architectures.includes(r)}}function compareTuples(e,r){return e.architectures.length-r.architectures.length}function parseTags(e){var r=e.split(".");var i=r.pop();var a={file:e,specificity:0};if(i!=="node")return;for(var n=0;n<r.length;n++){var t=r[n];if(t==="node"||t==="electron"||t==="node-webkit"){a.runtime=t}else if(t==="napi"){a.napi=true}else if(t.slice(0,3)==="abi"){a.abi=t.slice(3)}else if(t.slice(0,2)==="uv"){a.uv=t.slice(2)}else if(t.slice(0,4)==="armv"){a.armv=t.slice(4)}else if(t==="glibc"||t==="musl"){a.libc=t}else{continue}a.specificity++}return a}function matchTags(e,r){return function(i){if(i==null)return false;if(i.runtime&&i.runtime!==e&&!runtimeAgnostic(i))return false;if(i.abi&&i.abi!==r&&!i.napi)return false;if(i.uv&&i.uv!==uv)return false;if(i.armv&&i.armv!==armv)return false;if(i.libc&&i.libc!==libc)return false;return true}}function runtimeAgnostic(e){return e.runtime==="node"&&e.napi}function compareTags(e){return function(r,i){if(r.runtime!==i.runtime){return r.runtime===e?-1:1}else if(r.abi!==i.abi){return r.abi?-1:1}else if(r.specificity!==i.specificity){return r.specificity>i.specificity?-1:1}else{return 0}}}function isNwjs(){return!!(process.versions&&process.versions.nw)}function isElectron(){if(process.versions&&process.versions.electron)return true;if(process.env.ELECTRON_RUN_AS_NODE)return true;return typeof window!=="undefined"&&window.process&&window.process.type==="renderer"}function isAlpine(e){return e==="linux"&&fs.existsSync("/etc/alpine-release")}load.parseTags=parseTags;load.matchTags=matchTags;load.compareTags=compareTags;load.parseTuple=parseTuple;load.matchTuple=matchTuple;load.compareTuples=compareTuples},147:e=>{"use strict";e.exports=require("fs")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")}};var __webpack_module_cache__={};function __nccwpck_require__(e){var r=__webpack_module_cache__[e];if(r!==undefined){return r.exports}var i=__webpack_module_cache__[e]={exports:{}};var a=true;try{__webpack_modules__[e](i,i.exports,__nccwpck_require__);a=false}finally{if(a)delete __webpack_module_cache__[e]}return i.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var __webpack_exports__=__nccwpck_require__(290);module.exports=__webpack_exports__})();
@@ -1 +1 @@
1
- {"name":"isolated-vm","version":"5.0.4","description":"Access to multiple isolates","main":"isolated-vm.js","types":"isolated-vm.d.ts","engines":{"node":">=18.0.0"},"scripts":{"install":"prebuild-install || (node-gyp rebuild --release -j max && node-gyp clean)","rebuild":"node-gyp rebuild --release -j max","lint":"find src -name '*.cc' | xargs -n1 clang-tidy","test":"node test.js"},"dependencies":{"prebuild-install":"^7.1.2"},"devDependencies":{"isolated-vm":".","prebuild":"^13.0.1"},"binary":{"module_path":"out"},"repository":{"type":"git","url":"git+https://github.com/laverdet/isolated-vm.git"},"author":"https://github.com/laverdet/","license":"ISC","gypfile":true,"bugs":{"url":"https://github.com/laverdet/isolated-vm/issues"},"homepage":"https://github.com/laverdet/isolated-vm#readme","_lastModified":"2026-04-28T16:00:08.163Z"}
1
+ {"name":"isolated-vm","version":"6.1.2","description":"Access to multiple isolates","main":"isolated-vm.js","types":"isolated-vm.d.ts","engines":{"node":">=22.0.0"},"scripts":{"install":"node-gyp-build || node-gyp rebuild --release -j max","prebuild":"node scripts/run-prebuild.js","rebuild":"node-gyp rebuild --release -j max","lint":"find src -name '*.cc' | xargs -n1 clang-tidy","test":"node test.js"},"dependencies":{"node-gyp-build":"^4.8.4"},"devDependencies":{"isolated-vm":".","prebuildify":"^6.0.1"},"repository":{"type":"git","url":"git+https://github.com/laverdet/isolated-vm.git"},"author":"https://github.com/laverdet/","license":"ISC","gypfile":true,"bugs":{"url":"https://github.com/laverdet/isolated-vm/issues"},"homepage":"https://github.com/laverdet/isolated-vm#readme","_lastModified":"2026-05-06T11:08:55.908Z"}
@@ -0,0 +1,33 @@
1
+ const os = require('node:os');
2
+ const fs = require('node:fs');
3
+ const path = require('node:path');
4
+ const { spawnSync } = require('node:child_process');
5
+
6
+ const targetArgs = [
7
+ '--strip',
8
+ '--no-napi',
9
+ '--target',
10
+ '22.22.0',
11
+ '--target',
12
+ '24.14.0',
13
+ ];
14
+
15
+ if (process.platform === 'linux') {
16
+ targetArgs.push('--tag-libc');
17
+ }
18
+
19
+ const env = {
20
+ ...process.env,
21
+ MAKEFLAGS: `-j${os.cpus().length}`,
22
+ };
23
+
24
+ fs.rmSync(path.join(__dirname, '..', 'prebuilds'), { recursive: true, force: true });
25
+
26
+ const prebuildifyCli = require.resolve('prebuildify/bin.js');
27
+ const result = spawnSync(process.execPath, [prebuildifyCli, ...targetArgs], { stdio: 'inherit', env });
28
+
29
+ if (result.error) {
30
+ throw result.error;
31
+ }
32
+
33
+ process.exit(result.status ?? 1);
@@ -13,14 +13,12 @@ class LimitedAllocator : public v8::ArrayBuffer::Allocator {
13
13
  size_t next_check;
14
14
  int failures = 0;
15
15
 
16
-
17
16
  public:
18
17
  auto Check(size_t length) -> bool;
19
18
  explicit LimitedAllocator(class IsolateEnvironment& env, size_t limit);
20
19
  auto Allocate(size_t length) -> void* final;
21
20
  auto AllocateUninitialized(size_t length) -> void* final;
22
21
  void Free(void* data, size_t length) final;
23
- auto Reallocate(void* data, size_t old_length, size_t new_length) -> void* final;
24
22
 
25
23
  // This is used by ExternalCopy when an ArrayBuffer is transferred. The memory is not freed but
26
24
  // we should no longer count it against the isolate
@@ -115,17 +115,6 @@ void LimitedAllocator::Free(void* data, size_t length) {
115
115
  std::free(data);
116
116
  }
117
117
 
118
- auto LimitedAllocator::Reallocate(void* data, size_t old_length, size_t new_length) -> void* {
119
- auto delta = static_cast<ssize_t>(new_length) - static_cast<ssize_t>(old_length);
120
- if (delta > 0) {
121
- if (!Check(delta)) {
122
- return nullptr;
123
- }
124
- }
125
- env.extra_allocated_memory += delta;
126
- return ArrayBuffer::Allocator::Reallocate(data, old_length, new_length);
127
- }
128
-
129
118
  void LimitedAllocator::AdjustAllocatedSize(ptrdiff_t length) {
130
119
  env.extra_allocated_memory += length;
131
120
  }
@@ -92,7 +92,11 @@ class ClassHandle {
92
92
  template <typename... Args>
93
93
  void Add(const char* name, detail::MemberAccessorHolder impl, Args... args) {
94
94
  v8::Local<v8::String> name_handle = v8_symbol(name);
95
- proto->SetAccessor(name_handle, impl.getter.callback, impl.setter.callback);
95
+ v8::Local<v8::FunctionTemplate> setter;
96
+ if (impl.setter.callback != nullptr) {
97
+ setter = v8::FunctionTemplate::New(isolate, impl.setter.callback, name_handle);
98
+ }
99
+ proto->SetAccessorProperty(name_handle, v8::FunctionTemplate::New(isolate, impl.getter.callback, {}), setter);
96
100
  Add(args...);
97
101
  }
98
102
 
@@ -40,6 +40,7 @@ static auto GetStackBase() -> void* {
40
40
  base = (void*)((char*)ss.ss_sp - ss.ss_size);
41
41
  }
42
42
  return base;
43
+ }
43
44
  #elif defined __FreeBSD__
44
45
  #include <pthread_np.h>
45
46
  static auto GetStackBase() -> void* {
@@ -108,7 +108,7 @@ class IsolateEnvironment {
108
108
  std::atomic<unsigned int> remotes_count{0};
109
109
  v8::HeapStatistics last_heap {};
110
110
  // Copyable traits used to opt into destructor handle reset
111
- std::deque<v8::Persistent<v8::Promise, v8::CopyablePersistentTraits<v8::Promise>>> unhandled_promise_rejections;
111
+ std::deque<v8::Global<v8::Promise>> unhandled_promise_rejections;
112
112
  StringTable string_table;
113
113
 
114
114
  std::vector<v8::Eternal<v8::Data>> specifics;
@@ -157,14 +157,12 @@ struct MemberFunctionHolder : FunctionCallbackImpl {
157
157
  };
158
158
 
159
159
  // Member getters and setters
160
- struct MemberGetterHolder : GenericCallback<v8::AccessorNameGetterCallback,
161
- v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&> {
162
- using GenericCallback::GenericCallback;
160
+ struct MemberGetterHolder : FunctionCallbackImpl {
161
+ using FunctionCallbackImpl::FunctionCallbackImpl;
163
162
  };
164
163
 
165
- struct MemberSetterHolder : GenericCallback<v8::AccessorNameSetterCallback,
166
- v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&> {
167
- using GenericCallback::GenericCallback;
164
+ struct MemberSetterHolder : FunctionCallbackImpl {
165
+ using FunctionCallbackImpl::FunctionCallbackImpl;
168
166
  };
169
167
 
170
168
  struct MemberAccessorHolder {
@@ -229,12 +227,8 @@ template <
229
227
  >
230
228
  struct MemberAccessor : detail::MemberAccessorHolder {
231
229
  constexpr MemberAccessor() : MemberAccessorHolder{
232
- detail::MemberGetterHolder{detail::MemberGetterHolder::ToCallback<
233
- 0, typename UnboundGetter::type, UnboundGetter::template invoke<Getter>
234
- >()},
235
- detail::MemberSetterHolder{detail::MemberSetterHolder::ToCallback<
236
- 0, typename UnboundSetter::type, UnboundSetter::template invoke<Setter>
237
- >()}
230
+ detail::MemberGetterHolder{detail::MemberGetterHolder::ToCallback<-1, typename UnboundGetter::type, UnboundGetter::template invoke<Getter>>(), 0},
231
+ detail::MemberSetterHolder{detail::MemberSetterHolder::ToCallback<-1, typename UnboundSetter::type, UnboundSetter::template invoke<Setter>>(), 1},
238
232
  } {}
239
233
 
240
234
  private:
@@ -248,10 +242,8 @@ struct MemberAccessor : detail::MemberAccessorHolder {
248
242
  template <class GetterSignature, GetterSignature Getter>
249
243
  struct MemberAccessor<GetterSignature, Getter, std::nullptr_t, nullptr> : detail::MemberAccessorHolder {
250
244
  constexpr MemberAccessor() : MemberAccessorHolder{
251
- detail::MemberGetterHolder{detail::MemberGetterHolder::ToCallback<
252
- 0, typename UnboundGetter::type, UnboundGetter::template invoke<Getter>
253
- >()},
254
- detail::MemberSetterHolder{nullptr}
245
+ detail::MemberGetterHolder{detail::MemberGetterHolder::ToCallback<-1, typename UnboundGetter::type, UnboundGetter::template invoke<Getter>>(), 0},
246
+ detail::MemberSetterHolder{nullptr},
255
247
  } {}
256
248
 
257
249
  private:
@@ -63,14 +63,14 @@ void IsolateHolder::ScheduleTask(std::unique_ptr<Runnable> task, bool run_inline
63
63
  }
64
64
 
65
65
  // Methods for v8::TaskRunner
66
- void IsolateTaskRunner::PostTask(std::unique_ptr<v8::Task> task) {
66
+ void IsolateTaskRunner::PostTaskImpl(std::unique_ptr<v8::Task> task, const v8::SourceLocation& /*location*/) {
67
67
  auto env = weak_env.lock();
68
68
  if (env) {
69
69
  env->GetScheduler().Lock()->tasks.push(std::move(task));
70
70
  }
71
71
  }
72
72
 
73
- void IsolateTaskRunner::PostDelayedTask(std::unique_ptr<v8::Task> task, double delay_in_seconds) {
73
+ void IsolateTaskRunner::PostDelayedTaskImpl(std::unique_ptr<v8::Task> task, double delay_in_seconds, const v8::SourceLocation& /*location*/) {
74
74
  // wait_detached erases the type of the lambda into a std::function which must be
75
75
  // copyable. The unique_ptr is stored in a shared pointer so ownership can be handled correctly.
76
76
  auto shared_task = std::make_shared<std::unique_ptr<v8::Task>>(std::move(task));
@@ -52,9 +52,15 @@ class IsolateTaskRunner final : public TaskRunner {
52
52
  auto operator=(const IsolateTaskRunner&) = delete;
53
53
 
54
54
  // Methods for v8::TaskRunner
55
- void PostTask(std::unique_ptr<v8::Task> task) final;
56
- void PostDelayedTask(std::unique_ptr<v8::Task> task, double delay_in_seconds) final;
57
- void PostNonNestableTask(std::unique_ptr<v8::Task> task) final { PostTask(std::move(task)); }
55
+ void PostTaskImpl(std::unique_ptr<v8::Task> task, const v8::SourceLocation& /*location*/) final;
56
+ void PostDelayedTaskImpl(std::unique_ptr<v8::Task> task, double delay_in_seconds, const v8::SourceLocation& /*location*/) final;
57
+ void PostNonNestableTaskImpl(std::unique_ptr<v8::Task> task, const v8::SourceLocation& location) final {
58
+ #if V8_AT_LEAST(13, 3, 241)
59
+ PostTask(std::move(task), location);
60
+ #else
61
+ PostTask(std::move(task));
62
+ #endif
63
+ }
58
64
 
59
65
  private:
60
66
  std::weak_ptr<IsolateEnvironment> weak_env;
@@ -12,13 +12,13 @@ namespace ivm {
12
12
  class TaskRunner : public v8::TaskRunner {
13
13
  public:
14
14
  // Methods for v8::TaskRunner
15
- void PostTask(std::unique_ptr<v8::Task> task) override = 0;
16
- void PostDelayedTask(std::unique_ptr<v8::Task> task, double delay_in_seconds) override = 0;
17
- void PostIdleTask(std::unique_ptr<v8::IdleTask> /*task*/) final { std::terminate(); }
15
+ void PostTaskImpl(std::unique_ptr<v8::Task> task, const v8::SourceLocation& location) override = 0;
16
+ void PostDelayedTaskImpl(std::unique_ptr<v8::Task> task, double delay_in_seconds, const v8::SourceLocation& location) override = 0;
17
+ void PostIdleTaskImpl(std::unique_ptr<v8::IdleTask> /*task*/, const v8::SourceLocation& /*location*/) final { std::terminate(); }
18
18
  // Can't be final because symbol is also used in IsolatePlatformDelegate
19
19
  auto IdleTasksEnabled() -> bool override { return false; };
20
20
  auto NonNestableTasksEnabled() const -> bool final { return true; }
21
- void PostNonNestableDelayedTask(std::unique_ptr<v8::Task> /*task*/, double /*delay_in_seconds*/) final { std::terminate(); }
21
+ // void PostNonNestableDelayedTask(std::unique_ptr<v8::Task> /*task*/, double /*delay_in_seconds*/) final { std::terminate(); }
22
22
  auto NonNestableDelayedTasksEnabled() const -> bool final { return false; }
23
23
  };
24
24
 
@@ -17,7 +17,7 @@ namespace detail {
17
17
  template <size_t Index, class Type>
18
18
  struct HandleTupleElement {
19
19
  HandleTupleElement(v8::Isolate* isolate, v8::Local<Type> local) : persistent{isolate, local} {}
20
- v8::Persistent<Type, v8::NonCopyablePersistentTraits<Type>> persistent;
20
+ v8::Persistent<Type> persistent;
21
21
  };
22
22
 
23
23
  template <class Indices, class ...Types>
@@ -100,12 +100,11 @@ void ErrorStackGetter(Local<Name> /*property*/, const PropertyCallbackInfo<Value
100
100
  void AttachStackGetter(Local<Object> error, Local<Value> data) {
101
101
  Local<Context> context = Isolate::GetCurrent()->GetCurrentContext();
102
102
  Unmaybe(error->SetPrivate(context, GetPrivateStackSymbol(), data));
103
- Unmaybe(error->SetAccessor(
103
+ Unmaybe(error->SetNativeDataProperty(
104
104
  context,
105
105
  StringTable::Get().stack,
106
106
  ErrorStackGetter, nullptr,
107
107
  Local<Value>(),
108
- AccessControl::DEFAULT,
109
108
  PropertyAttribute::DontEnum
110
109
  ));
111
110
  }
@@ -13,7 +13,7 @@ class StackTraceHolder : public ClassHandle {
13
13
  private:
14
14
  static void AppendFileLocation(v8::Isolate* isolate, v8::Local<v8::StackFrame> frame, std::stringstream& ss);
15
15
  public:
16
- v8::Persistent<v8::StackTrace, v8::CopyablePersistentTraits<v8::StackTrace>> stack_trace;
16
+ v8::Global<v8::StackTrace> stack_trace;
17
17
  explicit StackTraceHolder(v8::Local<v8::StackTrace> stack_handle);
18
18
  static auto Definition() -> v8::Local<v8::FunctionTemplate>;
19
19
  static void AttachStack(v8::Local<v8::Object> error, v8::Local<v8::StackTrace> stack);
@@ -27,7 +27,7 @@ auto Deref(const v8::Persistent<T>& handle) -> v8::Local<T> {
27
27
  }
28
28
 
29
29
  template <typename T>
30
- auto Deref(const v8::Persistent<T, v8::CopyablePersistentTraits<T>>& handle) -> v8::Local<T> {
30
+ auto Deref(const v8::Global<T>& handle) -> v8::Local<T> {
31
31
  return v8::Local<T>::New(v8::Isolate::GetCurrent(), handle);
32
32
  }
33
33
 
@@ -1,7 +1,9 @@
1
1
  #pragma once
2
2
  #include "node_wrapper.h"
3
3
  #include "./v8_version.h"
4
- #if V8_AT_LEAST(12, 4, 254)
4
+ #if V8_AT_LEAST(13, 6, 233)
5
+ #include "v8_inspector/nodejs_v24.0.0.h"
6
+ #elif V8_AT_LEAST(12, 4, 254)
5
7
  #include "v8_inspector/nodejs_v22.0.0.h"
6
8
  #elif V8_AT_LEAST(11, 3, 244)
7
9
  #include "v8_inspector/nodejs_v20.0.0.h"
@@ -12,9 +12,13 @@ namespace ivm {
12
12
  /**
13
13
  * CallbackHandle implementation
14
14
  */
15
+ static std::unique_ptr<CallbackHandle> CallbackHandle_New_Wrapper(Local<Function> fn, MaybeLocal<Object> options) {
16
+ return CallbackHandle::New(fn, options);
17
+ }
18
+
15
19
  auto CallbackHandle::Definition() -> Local<FunctionTemplate> {
16
20
  return Inherit<TransferableHandle>(MakeClass(
17
- "Callback", ConstructorFunction<decltype(&New), &New>{}
21
+ "Callback", ConstructorFunction<decltype(&CallbackHandle_New_Wrapper), &CallbackHandle_New_Wrapper>{}
18
22
  ));
19
23
  }
20
24
 
@@ -21,7 +21,6 @@ ScriptOriginHolder::ScriptOriginHolder(MaybeLocal<Object> maybe_options, bool is
21
21
 
22
22
  ScriptOriginHolder::operator ScriptOrigin() const {
23
23
  return ScriptOrigin{
24
- Isolate::GetCurrent(),
25
24
  HandleCast<Local<String>>(filename),
26
25
  line_offset,
27
26
  column_offset,
@@ -27,9 +27,15 @@ ExternalCopyHandle::~ExternalCopyHandle() {
27
27
  Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-size);
28
28
  }
29
29
 
30
+ static std::unique_ptr<ExternalCopyHandle> ExternalCopyHandle_New_Wrapper(
31
+ v8::Local<v8::Value> value, v8::MaybeLocal<v8::Object> options
32
+ ) {
33
+ return ExternalCopyHandle::New(value, options);
34
+ }
35
+
30
36
  auto ExternalCopyHandle::Definition() -> Local<FunctionTemplate> {
31
37
  return Inherit<TransferableHandle>(MakeClass(
32
- "ExternalCopy", ConstructorFunction<decltype(&New), &New>{},
38
+ "ExternalCopy", ConstructorFunction<decltype(&ExternalCopyHandle_New_Wrapper), &ExternalCopyHandle_New_Wrapper>{},
33
39
  "totalExternalSize", StaticAccessor<decltype(&ExternalCopyHandle::TotalExternalSizeGetter), &ExternalCopyHandle::TotalExternalSizeGetter>{},
34
40
  "copy", MemberFunction<decltype(&ExternalCopyHandle::Copy), &ExternalCopyHandle::Copy>{},
35
41
  "copyInto", MemberFunction<decltype(&ExternalCopyHandle::CopyInto), &ExternalCopyHandle::CopyInto>{},
@@ -39,9 +39,13 @@ auto IsolateHandle::IsolateHandleTransferable::TransferIn() -> Local<Value> {
39
39
 
40
40
  IsolateHandle::IsolateHandle(shared_ptr<IsolateHolder> isolate) : isolate(std::move(isolate)) {}
41
41
 
42
+ static std::unique_ptr<ClassHandle> IsolateHandle_New_Wrapper(v8::MaybeLocal<v8::Object> options) {
43
+ return IsolateHandle::New(options);
44
+ }
45
+
42
46
  auto IsolateHandle::Definition() -> Local<FunctionTemplate> {
43
47
  return Inherit<TransferableHandle>(MakeClass(
44
- "Isolate", ConstructorFunction<decltype(&New), &New>{},
48
+ "Isolate", ConstructorFunction<decltype(&IsolateHandle_New_Wrapper), &IsolateHandle_New_Wrapper>{},
45
49
  "createSnapshot", FreeFunction<decltype(&CreateSnapshot), &CreateSnapshot>{},
46
50
  "compileScript", MemberFunction<decltype(&IsolateHandle::CompileScript<1>), &IsolateHandle::CompileScript<1>>{},
47
51
  "compileScriptSync", MemberFunction<decltype(&IsolateHandle::CompileScript<0>), &IsolateHandle::CompileScript<0>>{},
@@ -139,7 +143,7 @@ struct CreateContextRunner : public ThreePhaseTask {
139
143
  void Phase2() final {
140
144
  // Use custom deleter on the shared_ptr which will notify the isolate when we're probably done with this context
141
145
  struct ContextDeleter {
142
- void operator() (Persistent<Context>& context) const {
146
+ void operator() (v8::Persistent<Context>& context) const {
143
147
  auto& env = IsolateEnvironment::GetCurrent();
144
148
  context.Reset();
145
149
  env.GetIsolate()->ContextDisposedNotification();
@@ -483,16 +487,24 @@ auto IsolateHandle::CreateSnapshot(ArrayRange script_handles, MaybeLocal<String>
483
487
  }
484
488
 
485
489
  // Methods for v8::TaskRunner
486
- void PostTask(std::unique_ptr<v8::Task> task) final {
490
+ void PostTaskImpl(std::unique_ptr<v8::Task> task, const v8::SourceLocation& /*location*/) final {
487
491
  tasks.write()->push_back(std::move(task));
488
492
  }
489
- void PostDelayedTask(std::unique_ptr<v8::Task> task, double /*delay_in_seconds*/) final {
493
+ void PostDelayedTaskImpl(std::unique_ptr<v8::Task> task, double /*delay_in_seconds*/, const v8::SourceLocation& location) final {
490
494
  if (!done) {
495
+ #if V8_AT_LEAST(13, 3, 241)
496
+ PostTask(std::move(task), location);
497
+ #else
491
498
  PostTask(std::move(task));
499
+ #endif
492
500
  }
493
501
  }
494
- void PostNonNestableTask(std::unique_ptr<v8::Task> task) final {
495
- PostTask(std::move(task));
502
+ void PostNonNestableTaskImpl(std::unique_ptr<v8::Task> task, const v8::SourceLocation& location) final {
503
+ #if V8_AT_LEAST(13, 3, 241)
504
+ PostTask(std::move(task), location);
505
+ #else
506
+ PostTask(std::move(task));
507
+ #endif
496
508
  }
497
509
 
498
510
  private:
@@ -49,9 +49,13 @@ auto NativeModuleHandle::NativeModuleTransferable::TransferIn() -> Local<Value>
49
49
  */
50
50
  NativeModuleHandle::NativeModuleHandle(shared_ptr<NativeModule> module) : module(std::move(module)) {}
51
51
 
52
+ static std::unique_ptr<NativeModuleHandle> NativeModuleHandle_New_Wrapper(v8::Local<v8::String> value) {
53
+ return NativeModuleHandle::New(value);
54
+ }
55
+
52
56
  auto NativeModuleHandle::Definition() -> Local<FunctionTemplate> {
53
57
  return Inherit<TransferableHandle>(MakeClass(
54
- "NativeModule", ConstructorFunction<decltype(&New), &New>{},
58
+ "NativeModule", ConstructorFunction<decltype(&NativeModuleHandle_New_Wrapper), &NativeModuleHandle_New_Wrapper>{},
55
59
  "create", MemberFunction<decltype(&NativeModuleHandle::Create<1>), &NativeModuleHandle::Create<1>>{},
56
60
  "createSync", MemberFunction<decltype(&NativeModuleHandle::Create<0>), &NativeModuleHandle::Create<0>>{}
57
61
  ));
@@ -105,9 +105,13 @@ ReferenceData::ReferenceData(
105
105
  /**
106
106
  * ReferenceHandle implementation
107
107
  */
108
+ static std::unique_ptr<ReferenceHandle> ReferenceHandle_New_Wrapper(v8::Local<v8::Value> value, v8::MaybeLocal<v8::Object> options) {
109
+ return ReferenceHandle::New(value, options);
110
+ }
111
+
108
112
  auto ReferenceHandle::Definition() -> Local<FunctionTemplate> {
109
113
  return Inherit<TransferableHandle>(MakeClass(
110
- "Reference", ConstructorFunction<decltype(&New), &New>{},
114
+ "Reference", ConstructorFunction<decltype(&ReferenceHandle_New_Wrapper), &ReferenceHandle_New_Wrapper>{},
111
115
  "deref", MemberFunction<decltype(&ReferenceHandle::Deref), &ReferenceHandle::Deref>{},
112
116
  "derefInto", MemberFunction<decltype(&ReferenceHandle::DerefInto), &ReferenceHandle::DerefInto>{},
113
117
  "release", MemberFunction<decltype(&ReferenceHandle::Release), &ReferenceHandle::Release>{},
@@ -0,0 +1,426 @@
1
+ // Copyright 2016 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef V8_V8_INSPECTOR_H_
6
+ #define V8_V8_INSPECTOR_H_
7
+
8
+ #include <stdint.h>
9
+
10
+ #include <cctype>
11
+ #include <memory>
12
+
13
+ #include "v8-isolate.h" // NOLINT(build/include_directory)
14
+ #include "v8-local-handle.h" // NOLINT(build/include_directory)
15
+
16
+ namespace v8 {
17
+ class Context;
18
+ class Name;
19
+ class Object;
20
+ class StackTrace;
21
+ class Value;
22
+ } // namespace v8
23
+
24
+ namespace v8_inspector {
25
+
26
+ namespace internal {
27
+ class V8DebuggerId;
28
+ } // namespace internal
29
+
30
+ namespace protocol {
31
+ namespace Debugger {
32
+ namespace API {
33
+ class SearchMatch;
34
+ }
35
+ } // namespace Debugger
36
+ namespace Runtime {
37
+ namespace API {
38
+ class RemoteObject;
39
+ class StackTrace;
40
+ class StackTraceId;
41
+ } // namespace API
42
+ } // namespace Runtime
43
+ namespace Schema {
44
+ namespace API {
45
+ class Domain;
46
+ }
47
+ } // namespace Schema
48
+ } // namespace protocol
49
+
50
+ class V8_EXPORT StringView {
51
+ public:
52
+ StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {}
53
+
54
+ StringView(const uint8_t* characters, size_t length)
55
+ : m_is8Bit(true), m_length(length), m_characters8(characters) {}
56
+
57
+ StringView(const uint16_t* characters, size_t length)
58
+ : m_is8Bit(false), m_length(length), m_characters16(characters) {}
59
+
60
+ bool is8Bit() const { return m_is8Bit; }
61
+ size_t length() const { return m_length; }
62
+
63
+ // TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used
64
+ // here.
65
+ const uint8_t* characters8() const { return m_characters8; }
66
+ const uint16_t* characters16() const { return m_characters16; }
67
+
68
+ private:
69
+ bool m_is8Bit;
70
+ size_t m_length;
71
+ union {
72
+ const uint8_t* m_characters8;
73
+ const uint16_t* m_characters16;
74
+ };
75
+ };
76
+
77
+ class V8_EXPORT StringBuffer {
78
+ public:
79
+ virtual ~StringBuffer() = default;
80
+ virtual StringView string() const = 0;
81
+ // This method copies contents.
82
+ static std::unique_ptr<StringBuffer> create(StringView);
83
+ };
84
+
85
+ class V8_EXPORT V8ContextInfo {
86
+ public:
87
+ V8ContextInfo(v8::Local<v8::Context> context, int contextGroupId,
88
+ StringView humanReadableName)
89
+ : context(context),
90
+ contextGroupId(contextGroupId),
91
+ humanReadableName(humanReadableName),
92
+ hasMemoryOnConsole(false) {}
93
+
94
+ v8::Local<v8::Context> context;
95
+ // Each v8::Context is a part of a group. The group id must be non-zero.
96
+ int contextGroupId;
97
+ StringView humanReadableName;
98
+ StringView origin;
99
+ StringView auxData;
100
+ bool hasMemoryOnConsole;
101
+
102
+ static int executionContextId(v8::Local<v8::Context> context);
103
+
104
+ // Disallow copying and allocating this one.
105
+ enum NotNullTagEnum { NotNullLiteral };
106
+ void* operator new(size_t) = delete;
107
+ void* operator new(size_t, NotNullTagEnum, void*) = delete;
108
+ void* operator new(size_t, void*) = delete;
109
+ V8ContextInfo(const V8ContextInfo&) = delete;
110
+ V8ContextInfo& operator=(const V8ContextInfo&) = delete;
111
+ };
112
+
113
+ // This debugger id tries to be unique by generating two random
114
+ // numbers, which should most likely avoid collisions.
115
+ // Debugger id has a 1:1 mapping to context group. It is used to
116
+ // attribute stack traces to a particular debugging, when doing any
117
+ // cross-debugger operations (e.g. async step in).
118
+ // See also Runtime.UniqueDebuggerId in the protocol.
119
+ class V8_EXPORT V8DebuggerId {
120
+ public:
121
+ V8DebuggerId() = default;
122
+ V8DebuggerId(const V8DebuggerId&) = default;
123
+ V8DebuggerId& operator=(const V8DebuggerId&) = default;
124
+
125
+ std::unique_ptr<StringBuffer> toString() const;
126
+ bool isValid() const;
127
+ std::pair<int64_t, int64_t> pair() const;
128
+
129
+ private:
130
+ friend class internal::V8DebuggerId;
131
+ explicit V8DebuggerId(std::pair<int64_t, int64_t>);
132
+
133
+ int64_t m_first = 0;
134
+ int64_t m_second = 0;
135
+ };
136
+
137
+ struct V8_EXPORT V8StackFrame {
138
+ StringView sourceURL;
139
+ StringView functionName;
140
+ int lineNumber;
141
+ int columnNumber;
142
+ int scriptId;
143
+ };
144
+
145
+ class V8_EXPORT V8StackTrace {
146
+ public:
147
+ virtual StringView firstNonEmptySourceURL() const = 0;
148
+ virtual bool isEmpty() const = 0;
149
+ virtual StringView topSourceURL() const = 0;
150
+ virtual int topLineNumber() const = 0;
151
+ virtual int topColumnNumber() const = 0;
152
+ virtual int topScriptId() const = 0;
153
+ virtual StringView topFunctionName() const = 0;
154
+
155
+ virtual ~V8StackTrace() = default;
156
+ virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
157
+ buildInspectorObject(int maxAsyncDepth) const = 0;
158
+ virtual std::unique_ptr<StringBuffer> toString() const = 0;
159
+
160
+ // Safe to pass between threads, drops async chain.
161
+ virtual std::unique_ptr<V8StackTrace> clone() = 0;
162
+
163
+ virtual std::vector<V8StackFrame> frames() const = 0;
164
+ };
165
+
166
+ class V8_EXPORT V8InspectorSession {
167
+ public:
168
+ virtual ~V8InspectorSession() = default;
169
+
170
+ // Cross-context inspectable values (DOM nodes in different worlds, etc.).
171
+ class V8_EXPORT Inspectable {
172
+ public:
173
+ virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0;
174
+ virtual ~Inspectable() = default;
175
+ };
176
+ virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0;
177
+
178
+ // Dispatching protocol messages.
179
+ static bool canDispatchMethod(StringView method);
180
+ virtual void dispatchProtocolMessage(StringView message) = 0;
181
+ virtual std::vector<uint8_t> state() = 0;
182
+ virtual std::vector<std::unique_ptr<protocol::Schema::API::Domain>>
183
+ supportedDomains() = 0;
184
+
185
+ // Debugger actions.
186
+ virtual void schedulePauseOnNextStatement(StringView breakReason,
187
+ StringView breakDetails) = 0;
188
+ virtual void cancelPauseOnNextStatement() = 0;
189
+ virtual void breakProgram(StringView breakReason,
190
+ StringView breakDetails) = 0;
191
+ virtual void setSkipAllPauses(bool) = 0;
192
+ virtual void resume(bool setTerminateOnResume = false) = 0;
193
+ virtual void stepOver() = 0;
194
+ virtual std::vector<std::unique_ptr<protocol::Debugger::API::SearchMatch>>
195
+ searchInTextByLines(StringView text, StringView query, bool caseSensitive,
196
+ bool isRegex) = 0;
197
+
198
+ // Remote objects.
199
+ virtual std::unique_ptr<protocol::Runtime::API::RemoteObject> wrapObject(
200
+ v8::Local<v8::Context>, v8::Local<v8::Value>, StringView groupName,
201
+ bool generatePreview) = 0;
202
+
203
+ virtual bool unwrapObject(std::unique_ptr<StringBuffer>* error,
204
+ StringView objectId, v8::Local<v8::Value>*,
205
+ v8::Local<v8::Context>*,
206
+ std::unique_ptr<StringBuffer>* objectGroup) = 0;
207
+ virtual void releaseObjectGroup(StringView) = 0;
208
+ virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0;
209
+
210
+ struct V8_EXPORT EvaluateResult {
211
+ enum class ResultType {
212
+ kNotRun,
213
+ kSuccess,
214
+ kException,
215
+ };
216
+
217
+ ResultType type;
218
+ v8::Local<v8::Value> value;
219
+ };
220
+ // Evalaute 'expression' in the provided context. Does the same as
221
+ // Runtime#evaluate under-the-hood but exposed on the C++ side.
222
+ virtual EvaluateResult evaluate(v8::Local<v8::Context> context,
223
+ StringView expression,
224
+ bool includeCommandLineAPI = false) = 0;
225
+
226
+ // Prepare for shutdown (disables debugger pausing, etc.).
227
+ virtual void stop() = 0;
228
+ };
229
+
230
+ struct V8_EXPORT DeepSerializedValue {
231
+ explicit DeepSerializedValue(std::unique_ptr<StringBuffer> type,
232
+ v8::MaybeLocal<v8::Value> value = {})
233
+ : type(std::move(type)), value(value) {}
234
+ std::unique_ptr<StringBuffer> type;
235
+ v8::MaybeLocal<v8::Value> value;
236
+ };
237
+
238
+ struct V8_EXPORT DeepSerializationResult {
239
+ explicit DeepSerializationResult(
240
+ std::unique_ptr<DeepSerializedValue> serializedValue)
241
+ : serializedValue(std::move(serializedValue)), isSuccess(true) {}
242
+ explicit DeepSerializationResult(std::unique_ptr<StringBuffer> errorMessage)
243
+ : errorMessage(std::move(errorMessage)), isSuccess(false) {}
244
+
245
+ // Use std::variant when available.
246
+ std::unique_ptr<DeepSerializedValue> serializedValue;
247
+ std::unique_ptr<StringBuffer> errorMessage;
248
+ bool isSuccess;
249
+ };
250
+
251
+ class V8_EXPORT V8InspectorClient {
252
+ public:
253
+ virtual ~V8InspectorClient() = default;
254
+
255
+ virtual void runMessageLoopOnPause(int contextGroupId) {}
256
+ virtual void runMessageLoopOnInstrumentationPause(int contextGroupId) {
257
+ runMessageLoopOnPause(contextGroupId);
258
+ }
259
+ virtual void quitMessageLoopOnPause() {}
260
+ virtual void runIfWaitingForDebugger(int contextGroupId) {}
261
+
262
+ virtual void muteMetrics(int contextGroupId) {}
263
+ virtual void unmuteMetrics(int contextGroupId) {}
264
+
265
+ virtual void beginUserGesture() {}
266
+ virtual void endUserGesture() {}
267
+
268
+ virtual std::unique_ptr<DeepSerializationResult> deepSerialize(
269
+ v8::Local<v8::Value> v8Value, int maxDepth,
270
+ v8::Local<v8::Object> additionalParameters) {
271
+ return nullptr;
272
+ }
273
+ virtual std::unique_ptr<StringBuffer> valueSubtype(v8::Local<v8::Value>) {
274
+ return nullptr;
275
+ }
276
+ virtual std::unique_ptr<StringBuffer> descriptionForValueSubtype(
277
+ v8::Local<v8::Context>, v8::Local<v8::Value>) {
278
+ return nullptr;
279
+ }
280
+ virtual bool isInspectableHeapObject(v8::Local<v8::Object>) { return true; }
281
+
282
+ virtual v8::Local<v8::Context> ensureDefaultContextInGroup(
283
+ int contextGroupId) {
284
+ return v8::Local<v8::Context>();
285
+ }
286
+ virtual void beginEnsureAllContextsInGroup(int contextGroupId) {}
287
+ virtual void endEnsureAllContextsInGroup(int contextGroupId) {}
288
+
289
+ virtual void installAdditionalCommandLineAPI(v8::Local<v8::Context>,
290
+ v8::Local<v8::Object>) {}
291
+ virtual void consoleAPIMessage(int contextGroupId,
292
+ v8::Isolate::MessageErrorLevel level,
293
+ const StringView& message,
294
+ const StringView& url, unsigned lineNumber,
295
+ unsigned columnNumber, V8StackTrace*) {}
296
+ virtual v8::MaybeLocal<v8::Value> memoryInfo(v8::Isolate*,
297
+ v8::Local<v8::Context>) {
298
+ return v8::MaybeLocal<v8::Value>();
299
+ }
300
+
301
+ virtual void consoleTime(v8::Isolate* isolate, v8::Local<v8::String> label) {}
302
+ virtual void consoleTimeEnd(v8::Isolate* isolate,
303
+ v8::Local<v8::String> label) {}
304
+ virtual void consoleTimeStamp(v8::Isolate* isolate,
305
+ v8::Local<v8::String> label) {}
306
+ virtual void consoleTimeStampWithArgs(
307
+ v8::Isolate* isolate, v8::Local<v8::String> label,
308
+ const v8::LocalVector<v8::Value>& args) {}
309
+ virtual void consoleClear(int contextGroupId) {}
310
+ virtual double currentTimeMS() { return 0; }
311
+ typedef void (*TimerCallback)(void*);
312
+ virtual void startRepeatingTimer(double, TimerCallback, void* data) {}
313
+ virtual void cancelTimer(void* data) {}
314
+
315
+ // TODO(dgozman): this was added to support service worker shadow page. We
316
+ // should not connect at all.
317
+ virtual bool canExecuteScripts(int contextGroupId) { return true; }
318
+
319
+ virtual void maxAsyncCallStackDepthChanged(int depth) {}
320
+
321
+ virtual std::unique_ptr<StringBuffer> resourceNameToUrl(
322
+ const StringView& resourceName) {
323
+ return nullptr;
324
+ }
325
+
326
+ // The caller would defer to generating a random 64 bit integer if
327
+ // this method returns 0.
328
+ virtual int64_t generateUniqueId() { return 0; }
329
+
330
+ virtual void dispatchError(v8::Local<v8::Context>, v8::Local<v8::Message>,
331
+ v8::Local<v8::Value>) {}
332
+ };
333
+
334
+ // These stack trace ids are intended to be passed between debuggers and be
335
+ // resolved later. This allows to track cross-debugger calls and step between
336
+ // them if a single client connects to multiple debuggers.
337
+ struct V8_EXPORT V8StackTraceId {
338
+ uintptr_t id;
339
+ std::pair<int64_t, int64_t> debugger_id;
340
+ bool should_pause = false;
341
+
342
+ V8StackTraceId();
343
+ V8StackTraceId(const V8StackTraceId&) = default;
344
+ V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id);
345
+ V8StackTraceId(uintptr_t id, const std::pair<int64_t, int64_t> debugger_id,
346
+ bool should_pause);
347
+ explicit V8StackTraceId(StringView);
348
+ V8StackTraceId& operator=(const V8StackTraceId&) = default;
349
+ V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default;
350
+ ~V8StackTraceId() = default;
351
+
352
+ bool IsInvalid() const;
353
+ std::unique_ptr<StringBuffer> ToString();
354
+ };
355
+
356
+ class V8_EXPORT V8Inspector {
357
+ public:
358
+ static std::unique_ptr<V8Inspector> create(v8::Isolate*, V8InspectorClient*);
359
+ virtual ~V8Inspector() = default;
360
+
361
+ // Contexts instrumentation.
362
+ virtual void contextCreated(const V8ContextInfo&) = 0;
363
+ virtual void contextDestroyed(v8::Local<v8::Context>) = 0;
364
+ virtual void resetContextGroup(int contextGroupId) = 0;
365
+ virtual v8::MaybeLocal<v8::Context> contextById(int contextId) = 0;
366
+ virtual V8DebuggerId uniqueDebuggerId(int contextId) = 0;
367
+ virtual uint64_t isolateId() = 0;
368
+
369
+ // Various instrumentation.
370
+ virtual void idleStarted() = 0;
371
+ virtual void idleFinished() = 0;
372
+
373
+ // Async stack traces instrumentation.
374
+ virtual void asyncTaskScheduled(StringView taskName, void* task,
375
+ bool recurring) = 0;
376
+ virtual void asyncTaskCanceled(void* task) = 0;
377
+ virtual void asyncTaskStarted(void* task) = 0;
378
+ virtual void asyncTaskFinished(void* task) = 0;
379
+ virtual void allAsyncTasksCanceled() = 0;
380
+
381
+ virtual V8StackTraceId storeCurrentStackTrace(StringView description) = 0;
382
+ virtual void externalAsyncTaskStarted(const V8StackTraceId& parent) = 0;
383
+ virtual void externalAsyncTaskFinished(const V8StackTraceId& parent) = 0;
384
+
385
+ // Exceptions instrumentation.
386
+ virtual unsigned exceptionThrown(v8::Local<v8::Context>, StringView message,
387
+ v8::Local<v8::Value> exception,
388
+ StringView detailedMessage, StringView url,
389
+ unsigned lineNumber, unsigned columnNumber,
390
+ std::unique_ptr<V8StackTrace>,
391
+ int scriptId) = 0;
392
+ virtual void exceptionRevoked(v8::Local<v8::Context>, unsigned exceptionId,
393
+ StringView message) = 0;
394
+ virtual bool associateExceptionData(v8::Local<v8::Context>,
395
+ v8::Local<v8::Value> exception,
396
+ v8::Local<v8::Name> key,
397
+ v8::Local<v8::Value> value) = 0;
398
+
399
+ // Connection.
400
+ class V8_EXPORT Channel {
401
+ public:
402
+ virtual ~Channel() = default;
403
+ virtual void sendResponse(int callId,
404
+ std::unique_ptr<StringBuffer> message) = 0;
405
+ virtual void sendNotification(std::unique_ptr<StringBuffer> message) = 0;
406
+ virtual void flushProtocolNotifications() = 0;
407
+ };
408
+ enum ClientTrustLevel { kUntrusted, kFullyTrusted };
409
+ enum SessionPauseState { kWaitingForDebugger, kNotWaitingForDebugger };
410
+ // TODO(chromium:1352175): remove default value once downstream change lands.
411
+ virtual std::unique_ptr<V8InspectorSession> connect(
412
+ int contextGroupId, Channel*, StringView state,
413
+ ClientTrustLevel client_trust_level,
414
+ SessionPauseState = kNotWaitingForDebugger) {
415
+ return nullptr;
416
+ }
417
+
418
+ // API methods.
419
+ virtual std::unique_ptr<V8StackTrace> createStackTrace(
420
+ v8::Local<v8::StackTrace>) = 0;
421
+ virtual std::unique_ptr<V8StackTrace> captureStackTrace(bool fullStack) = 0;
422
+ };
423
+
424
+ } // namespace v8_inspector
425
+
426
+ #endif // V8_V8_INSPECTOR_H_
@@ -1 +1 @@
1
- {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-04-28T16:00:08.625Z"}
1
+ {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-05-06T11:08:56.346Z"}
@@ -1 +1 @@
1
- {"name":"winston-transport","description":"Base stream implementations for winston@3 and up.","version":"4.7.0","main":"index.js","browser":"dist/index.js","scripts":{"lint":"eslint test/*.js index.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","pretest":"npm run lint && npm run build","test":"nyc mocha test/*.test.js","report":"nyc report --reporter=lcov","build":"rimraf dist && babel *.js -d ./dist","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git@github.com:winstonjs/winston-transport.git"},"keywords":["winston","transport","winston3"],"author":"Charlie Robbins <charlie.robbins@gmail.com>","license":"MIT","bugs":{"url":"https://github.com/winstonjs/winston-transport/issues"},"homepage":"https://github.com/winstonjs/winston-transport#readme","dependencies":{"logform":"^2.3.2","readable-stream":"^3.6.0","triple-beam":"^1.3.0"},"devDependencies":{"@types/node":"^20.8.6","abstract-winston-transport":">=0.5.1","assume":"^2.3.0","babel-cli":"^6.26.0","babel-preset-env":"^1.7.0","deep-equal":"^2.0.5","eslint":"^8.8.0","@dabh/eslint-config-populist":"^5.0.0","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^5.0.5","winston-compat":"^0.1.5"},"engines":{"node":">= 12.0.0"},"_lastModified":"2026-04-28T16:00:08.939Z"}
1
+ {"name":"winston-transport","description":"Base stream implementations for winston@3 and up.","version":"4.7.0","main":"index.js","browser":"dist/index.js","scripts":{"lint":"eslint test/*.js index.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","pretest":"npm run lint && npm run build","test":"nyc mocha test/*.test.js","report":"nyc report --reporter=lcov","build":"rimraf dist && babel *.js -d ./dist","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git@github.com:winstonjs/winston-transport.git"},"keywords":["winston","transport","winston3"],"author":"Charlie Robbins <charlie.robbins@gmail.com>","license":"MIT","bugs":{"url":"https://github.com/winstonjs/winston-transport/issues"},"homepage":"https://github.com/winstonjs/winston-transport#readme","dependencies":{"logform":"^2.3.2","readable-stream":"^3.6.0","triple-beam":"^1.3.0"},"devDependencies":{"@types/node":"^20.8.6","abstract-winston-transport":">=0.5.1","assume":"^2.3.0","babel-cli":"^6.26.0","babel-preset-env":"^1.7.0","deep-equal":"^2.0.5","eslint":"^8.8.0","@dabh/eslint-config-populist":"^5.0.0","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^5.0.5","winston-compat":"^0.1.5"},"engines":{"node":">= 12.0.0"},"_lastModified":"2026-05-06T11:08:56.647Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-workflow-javascript",
3
- "version": "2.1.0-beta.23",
3
+ "version": "2.1.0-beta.25",
4
4
  "displayName": "Workflow: JavaScript",
5
5
  "displayName.zh-CN": "工作流:JavaScript 节点",
6
6
  "description": "Execute a piece of JavaScript in an isolated Node.js environment.",
@@ -25,7 +25,7 @@
25
25
  "@codemirror/state": "^6.4.1",
26
26
  "@codemirror/view": "^6.37.2",
27
27
  "codemirror": "^6.0.2",
28
- "isolated-vm": "^5.0.4",
28
+ "isolated-vm": "^6.1.2",
29
29
  "joi": "^17.13.3",
30
30
  "jshint": "^2.13.6",
31
31
  "node-gyp": "^10.2.0"
@@ -38,5 +38,5 @@
38
38
  "Workflow"
39
39
  ],
40
40
  "license": "Apache-2.0",
41
- "gitHead": "bb4c0d3551bf9eff505b63756dd24a0813231f16"
41
+ "gitHead": "824f8b8200e9fe086135768934d3ef427b212446"
42
42
  }