@nocobase/plugin-workflow-javascript 2.1.0-beta.25 → 2.1.0-beta.27
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/dist/externalVersion.js +4 -4
- package/dist/node_modules/joi/package.json +1 -1
- package/dist/node_modules/quickjs-emscripten/017c8a1a1898bfe7b7ae.wasm +0 -0
- package/dist/node_modules/quickjs-emscripten/161.index.js +50 -0
- package/dist/node_modules/quickjs-emscripten/277.index.js +27 -0
- package/dist/node_modules/quickjs-emscripten/302.index.js +55 -0
- package/dist/node_modules/quickjs-emscripten/45d53437811cf6eec760.wasm +0 -0
- package/dist/node_modules/quickjs-emscripten/712.index.js +5566 -0
- package/dist/node_modules/quickjs-emscripten/96b24985ab62871ec2a0.wasm +0 -0
- package/dist/node_modules/quickjs-emscripten/9a4b9654a8a7f4d515ba.wasm +0 -0
- package/dist/node_modules/quickjs-emscripten/LICENSE +21 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.d.mts +57 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.d.ts +57 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.global.js +7309 -0
- package/dist/node_modules/quickjs-emscripten/dist/index.js +1 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.d.mts +39 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.d.ts +39 -0
- package/dist/node_modules/quickjs-emscripten/dist/variants.js +2 -0
- package/dist/node_modules/quickjs-emscripten/package.json +1 -0
- package/dist/node_modules/winston-transport/package.json +1 -1
- package/dist/server/QuickJs.js +135 -0
- package/dist/server/ScriptInstruction.d.ts +1 -1
- package/dist/server/ScriptInstruction.js +2 -2
- package/package.json +3 -8
- package/dist/node_modules/isolated-vm/.clang-tidy +0 -13
- package/dist/node_modules/isolated-vm/.dockerignore +0 -9
- package/dist/node_modules/isolated-vm/Dockerfile.alpine +0 -9
- package/dist/node_modules/isolated-vm/Dockerfile.debian +0 -12
- package/dist/node_modules/isolated-vm/LICENSE +0 -13
- package/dist/node_modules/isolated-vm/binding.gyp +0 -120
- package/dist/node_modules/isolated-vm/include.js +0 -3
- package/dist/node_modules/isolated-vm/inspector-example.js +0 -59
- package/dist/node_modules/isolated-vm/isolated-vm-6.1.2.tgz +0 -0
- package/dist/node_modules/isolated-vm/isolated-vm.d.ts +0 -820
- package/dist/node_modules/isolated-vm/isolated-vm.js +0 -1
- package/dist/node_modules/isolated-vm/native-example/binding.gyp +0 -23
- package/dist/node_modules/isolated-vm/native-example/example.cc +0 -61
- package/dist/node_modules/isolated-vm/native-example/package.json +0 -13
- package/dist/node_modules/isolated-vm/native-example/usage.js +0 -35
- package/dist/node_modules/isolated-vm/package.json +0 -1
- package/dist/node_modules/isolated-vm/prebuilds/darwin-arm64/isolated-vm.abi127.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/darwin-arm64/isolated-vm.abi137.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi127.glibc.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi127.musl.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi137.glibc.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-arm64/isolated-vm.abi137.musl.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi127.glibc.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi127.musl.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi137.glibc.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/linux-x64/isolated-vm.abi137.musl.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/win32-x64/isolated-vm.abi127.node +0 -0
- package/dist/node_modules/isolated-vm/prebuilds/win32-x64/isolated-vm.abi137.node +0 -0
- package/dist/node_modules/isolated-vm/scripts/run-prebuild.js +0 -33
- package/dist/node_modules/isolated-vm/src/external_copy/error.h +0 -33
- package/dist/node_modules/isolated-vm/src/external_copy/external_copy.cc +0 -509
- package/dist/node_modules/isolated-vm/src/external_copy/external_copy.h +0 -117
- package/dist/node_modules/isolated-vm/src/external_copy/serializer.cc +0 -85
- package/dist/node_modules/isolated-vm/src/external_copy/serializer.h +0 -136
- package/dist/node_modules/isolated-vm/src/external_copy/serializer_nortti.cc +0 -73
- package/dist/node_modules/isolated-vm/src/external_copy/string.cc +0 -124
- package/dist/node_modules/isolated-vm/src/external_copy/string.h +0 -28
- package/dist/node_modules/isolated-vm/src/isolate/allocator.h +0 -30
- package/dist/node_modules/isolated-vm/src/isolate/allocator_nortti.cc +0 -131
- package/dist/node_modules/isolated-vm/src/isolate/class_handle.h +0 -338
- package/dist/node_modules/isolated-vm/src/isolate/cpu_profile_manager.cc +0 -220
- package/dist/node_modules/isolated-vm/src/isolate/cpu_profile_manager.h +0 -100
- package/dist/node_modules/isolated-vm/src/isolate/environment.cc +0 -627
- package/dist/node_modules/isolated-vm/src/isolate/environment.h +0 -381
- package/dist/node_modules/isolated-vm/src/isolate/executor.cc +0 -198
- package/dist/node_modules/isolated-vm/src/isolate/executor.h +0 -183
- package/dist/node_modules/isolated-vm/src/isolate/external.h +0 -64
- package/dist/node_modules/isolated-vm/src/isolate/functor_runners.h +0 -97
- package/dist/node_modules/isolated-vm/src/isolate/generic/array.h +0 -145
- package/dist/node_modules/isolated-vm/src/isolate/generic/callbacks.h +0 -264
- package/dist/node_modules/isolated-vm/src/isolate/generic/error.h +0 -140
- package/dist/node_modules/isolated-vm/src/isolate/generic/extract_params.h +0 -145
- package/dist/node_modules/isolated-vm/src/isolate/generic/handle_cast.h +0 -257
- package/dist/node_modules/isolated-vm/src/isolate/generic/read_option.h +0 -47
- package/dist/node_modules/isolated-vm/src/isolate/holder.cc +0 -88
- package/dist/node_modules/isolated-vm/src/isolate/holder.h +0 -69
- package/dist/node_modules/isolated-vm/src/isolate/inspector.cc +0 -200
- package/dist/node_modules/isolated-vm/src/isolate/inspector.h +0 -70
- package/dist/node_modules/isolated-vm/src/isolate/node_wrapper.h +0 -15
- package/dist/node_modules/isolated-vm/src/isolate/platform_delegate.cc +0 -22
- package/dist/node_modules/isolated-vm/src/isolate/platform_delegate.h +0 -46
- package/dist/node_modules/isolated-vm/src/isolate/remote_handle.h +0 -164
- package/dist/node_modules/isolated-vm/src/isolate/run_with_timeout.h +0 -171
- package/dist/node_modules/isolated-vm/src/isolate/runnable.h +0 -29
- package/dist/node_modules/isolated-vm/src/isolate/scheduler.cc +0 -191
- package/dist/node_modules/isolated-vm/src/isolate/scheduler.h +0 -165
- package/dist/node_modules/isolated-vm/src/isolate/specific.h +0 -35
- package/dist/node_modules/isolated-vm/src/isolate/stack_trace.cc +0 -218
- package/dist/node_modules/isolated-vm/src/isolate/stack_trace.h +0 -24
- package/dist/node_modules/isolated-vm/src/isolate/strings.h +0 -127
- package/dist/node_modules/isolated-vm/src/isolate/three_phase_task.cc +0 -385
- package/dist/node_modules/isolated-vm/src/isolate/three_phase_task.h +0 -136
- package/dist/node_modules/isolated-vm/src/isolate/transferable.h +0 -15
- package/dist/node_modules/isolated-vm/src/isolate/util.h +0 -45
- package/dist/node_modules/isolated-vm/src/isolate/v8_inspector_wrapper.h +0 -14
- package/dist/node_modules/isolated-vm/src/isolate/v8_version.h +0 -12
- package/dist/node_modules/isolated-vm/src/isolated_vm.h +0 -71
- package/dist/node_modules/isolated-vm/src/lib/covariant.h +0 -50
- package/dist/node_modules/isolated-vm/src/lib/lockable.h +0 -178
- package/dist/node_modules/isolated-vm/src/lib/suspend.h +0 -106
- package/dist/node_modules/isolated-vm/src/lib/thread_pool.cc +0 -98
- package/dist/node_modules/isolated-vm/src/lib/thread_pool.h +0 -45
- package/dist/node_modules/isolated-vm/src/lib/timer.cc +0 -233
- package/dist/node_modules/isolated-vm/src/lib/timer.h +0 -36
- package/dist/node_modules/isolated-vm/src/module/callback.cc +0 -155
- package/dist/node_modules/isolated-vm/src/module/callback.h +0 -64
- package/dist/node_modules/isolated-vm/src/module/context_handle.cc +0 -241
- package/dist/node_modules/isolated-vm/src/module/context_handle.h +0 -35
- package/dist/node_modules/isolated-vm/src/module/evaluation.cc +0 -108
- package/dist/node_modules/isolated-vm/src/module/evaluation.h +0 -99
- package/dist/node_modules/isolated-vm/src/module/external_copy_handle.cc +0 -125
- package/dist/node_modules/isolated-vm/src/module/external_copy_handle.h +0 -64
- package/dist/node_modules/isolated-vm/src/module/isolate.cc +0 -136
- package/dist/node_modules/isolated-vm/src/module/isolate_handle.cc +0 -623
- package/dist/node_modules/isolated-vm/src/module/isolate_handle.h +0 -47
- package/dist/node_modules/isolated-vm/src/module/lib_handle.cc +0 -77
- package/dist/node_modules/isolated-vm/src/module/lib_handle.h +0 -28
- package/dist/node_modules/isolated-vm/src/module/module_handle.cc +0 -475
- package/dist/node_modules/isolated-vm/src/module/module_handle.h +0 -68
- package/dist/node_modules/isolated-vm/src/module/native_module_handle.cc +0 -108
- package/dist/node_modules/isolated-vm/src/module/native_module_handle.h +0 -49
- package/dist/node_modules/isolated-vm/src/module/reference_handle.cc +0 -640
- package/dist/node_modules/isolated-vm/src/module/reference_handle.h +0 -106
- package/dist/node_modules/isolated-vm/src/module/script_handle.cc +0 -107
- package/dist/node_modules/isolated-vm/src/module/script_handle.h +0 -37
- package/dist/node_modules/isolated-vm/src/module/session_handle.cc +0 -173
- package/dist/node_modules/isolated-vm/src/module/session_handle.h +0 -31
- package/dist/node_modules/isolated-vm/src/module/transferable.cc +0 -268
- package/dist/node_modules/isolated-vm/src/module/transferable.h +0 -42
- package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v18.0.0.h +0 -360
- package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v18.3.0.h +0 -376
- package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v20.0.0.h +0 -397
- package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v22.0.0.h +0 -419
- package/dist/node_modules/isolated-vm/vendor/v8_inspector/nodejs_v24.0.0.h +0 -426
- package/dist/server/IsolatedVm.js +0 -75
|
@@ -1 +0,0 @@
|
|
|
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,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
'targets': [
|
|
3
|
-
{
|
|
4
|
-
'target_name': 'isolated-native-example',
|
|
5
|
-
'cflags_cc!': [ '-fno-exceptions' ],
|
|
6
|
-
'xcode_settings': {
|
|
7
|
-
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
|
|
8
|
-
},
|
|
9
|
-
'msvs_settings': {
|
|
10
|
-
'VCCLCompilerTool': {
|
|
11
|
-
'ExceptionHandling': '1',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
'include_dirs': [
|
|
15
|
-
'<!(node -e "require(\'nan\')")',
|
|
16
|
-
'<!(node -e "require(\'isolated-vm/include\')")',
|
|
17
|
-
],
|
|
18
|
-
'sources': [
|
|
19
|
-
'example.cc',
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Example module w/ async function
|
|
2
|
-
|
|
3
|
-
#include <nan.h> // You don't have to use nan, but it's supported
|
|
4
|
-
#include <isolated_vm.h>
|
|
5
|
-
|
|
6
|
-
#include <chrono>
|
|
7
|
-
#include <thread>
|
|
8
|
-
|
|
9
|
-
// `using namespace` is omitted to better show which interfaces exist where.
|
|
10
|
-
|
|
11
|
-
// `Runnable` is used for async function calls. It is possible that `Run` will never actually be
|
|
12
|
-
// called, in the case the isolate is disposed. You should make sure to cleanup in the destructor
|
|
13
|
-
// instead of `Run`.
|
|
14
|
-
struct TimeoutCallback : public isolated_vm::Runnable {
|
|
15
|
-
// `RemoteHandle` should be used instead of `v8::Persistent` or `nan::Persistent`
|
|
16
|
-
isolated_vm::RemoteHandle<v8::Context> context;
|
|
17
|
-
isolated_vm::RemoteHandle<v8::Function> fn;
|
|
18
|
-
|
|
19
|
-
TimeoutCallback(
|
|
20
|
-
isolated_vm::RemoteHandle<v8::Context> context,
|
|
21
|
-
isolated_vm::RemoteHandle<v8::Function> fn
|
|
22
|
-
) :
|
|
23
|
-
context(std::move(context)),
|
|
24
|
-
fn(std::move(fn)) {}
|
|
25
|
-
|
|
26
|
-
void Run() override {
|
|
27
|
-
// `v8::Locker` and `v8::HandleScope` are already set up and the isolate is entered. All that is
|
|
28
|
-
// left to do is enter a context.
|
|
29
|
-
v8::Context::Scope context_scope(*context);
|
|
30
|
-
v8::Local<v8::Function> local_fn = *fn;
|
|
31
|
-
v8::Local<v8::Value> argv[0];
|
|
32
|
-
Nan::Call(local_fn, v8::Local<v8::Object>::Cast(Nan::Undefined()), 0, argv);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
NAN_METHOD(timeout) {
|
|
37
|
-
isolated_vm::IsolateHolder isolate_holder = isolated_vm::IsolateHolder::GetCurrent();
|
|
38
|
-
isolated_vm::RemoteHandle<v8::Context> context(v8::Isolate::GetCurrent()->GetCurrentContext());
|
|
39
|
-
isolated_vm::RemoteHandle<v8::Function> fn(v8::Local<v8::Function>::Cast(info[0]));
|
|
40
|
-
|
|
41
|
-
uint32_t ms = Nan::To<uint32_t>(info[1]).FromJust();
|
|
42
|
-
std::thread timeout_thread([=]() mutable {
|
|
43
|
-
// Note that in this closure it is not safe to call into v8! The only thing you can do is
|
|
44
|
-
// schedule a task.
|
|
45
|
-
std::this_thread::sleep_for(std::chrono::milliseconds(ms));
|
|
46
|
-
isolate_holder.ScheduleTask(std::make_unique<TimeoutCallback>(std::move(context), std::move(fn)));
|
|
47
|
-
});
|
|
48
|
-
timeout_thread.detach();
|
|
49
|
-
|
|
50
|
-
info.GetReturnValue().Set(Nan::Undefined());
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
ISOLATED_VM_MODULE void InitForContext(v8::Isolate* isolate, v8::Local<v8::Context> context, v8::Local<v8::Object> target) {
|
|
54
|
-
Nan::Set(target, Nan::New("timeout").ToLocalChecked(), Nan::GetFunction(Nan::New<v8::FunctionTemplate>(timeout)).ToLocalChecked());
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
NAN_MODULE_INIT(init) {
|
|
58
|
-
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
|
59
|
-
InitForContext(isolate, isolate->GetCurrentContext(), target);
|
|
60
|
-
}
|
|
61
|
-
NODE_MODULE(native, init);
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const ivm = require('isolated-vm');
|
|
3
|
-
|
|
4
|
-
// You *must* require the extension in nodejs first.
|
|
5
|
-
require('.');
|
|
6
|
-
|
|
7
|
-
// `NativeModule` constructor takes a full path to a native module. `require.resolve` handles that
|
|
8
|
-
// for us, and finds the module path from `package.json`.
|
|
9
|
-
const example = new ivm.NativeModule(require.resolve('.'));
|
|
10
|
-
|
|
11
|
-
// Create an isolate like normal
|
|
12
|
-
let isolate = new ivm.Isolate;
|
|
13
|
-
let context = isolate.createContextSync();
|
|
14
|
-
let global = context.global;
|
|
15
|
-
|
|
16
|
-
// Now you can load this module into the isolate. `create` or `createSync` call `InitForContext` in
|
|
17
|
-
// C++ which returns a reference to this module for a specific context. The return value is an
|
|
18
|
-
// instance of `ivm.Reference` which is just the same object that you would get by doing
|
|
19
|
-
// `require('native-example')` in plain nodejs. The compiled native module is also compatible with
|
|
20
|
-
// plain nodejs as well.
|
|
21
|
-
global.setSync('module', example.createSync(context).derefInto());
|
|
22
|
-
|
|
23
|
-
// Create unsafe log function
|
|
24
|
-
global.setSync('log', new ivm.Reference(function(...args) {
|
|
25
|
-
console.log(...args);
|
|
26
|
-
}));
|
|
27
|
-
|
|
28
|
-
// Now we can test the function
|
|
29
|
-
let script = isolate.compileScriptSync(`module.timeout(function() {
|
|
30
|
-
log.apply(0, [ "Timeout triggered" ]);
|
|
31
|
-
}, 1000);`);
|
|
32
|
-
console.log("Before runSync");
|
|
33
|
-
script.runSync(context);
|
|
34
|
-
console.log("After runSync");
|
|
35
|
-
// logs: 123
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,33 +0,0 @@
|
|
|
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);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
#include "external_copy.h"
|
|
3
|
-
#include "./string.h"
|
|
4
|
-
|
|
5
|
-
namespace ivm {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Make a special case for errors so if someone throws then a similar error will come out the other
|
|
9
|
-
* side.
|
|
10
|
-
*/
|
|
11
|
-
class ExternalCopyError : public ExternalCopy {
|
|
12
|
-
friend class ExternalCopy;
|
|
13
|
-
public:
|
|
14
|
-
enum class ErrorType { Error, RangeError, ReferenceError, SyntaxError, TypeError, CustomError };
|
|
15
|
-
|
|
16
|
-
ExternalCopyError(
|
|
17
|
-
ErrorType error_type,
|
|
18
|
-
ExternalCopyString name,
|
|
19
|
-
ExternalCopyString message,
|
|
20
|
-
ExternalCopyString stack
|
|
21
|
-
);
|
|
22
|
-
ExternalCopyError(ErrorType error_type, const char* message, const std::string& stack = "");
|
|
23
|
-
|
|
24
|
-
auto CopyInto(bool transfer_in = false) -> v8::Local<v8::Value> final;
|
|
25
|
-
|
|
26
|
-
private:
|
|
27
|
-
ErrorType error_type;
|
|
28
|
-
ExternalCopyString name;
|
|
29
|
-
ExternalCopyString message;
|
|
30
|
-
ExternalCopyString stack;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
} // namespace ivm
|