Compare commits

..

2 Commits

Author SHA1 Message Date
5d123250b3 remove unused Cargo.nix
Some checks failed
Build && Deploy / cargo build (push) Has been cancelled
Reviewed-on: #27
2025-07-31 01:33:49 +00:00
Akulij
d70c8776bc rm Cargo.mix since it's not used anymore
Some checks failed
Build && Deploy / cargo build (push) Has been cancelled
2025-07-31 07:32:04 +06:00
3 changed files with 7 additions and 11280 deletions

11274
Cargo.nix

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,2 @@
pub mod v8;
pub mod quickjs;
// pub mod mlua;

View File

@ -102,8 +102,9 @@ impl V8Runtime {
Ok(event) => event,
Err(err) => break,
};
let (event, v8runtime) = (event.event, event.runtime);
match event {
Event::GetScriptConfig(script) => {
EventType::GetScriptConfig(script) => {
let code = FastString::from(script);
let result = runtime.execute_script("", code).unwrap();
@ -115,7 +116,7 @@ impl V8Runtime {
// rtx.send(RuntimeReturn::Value(unsafe { V8Value::new(SerdeValue::from(result)) }))
rtx.send(RuntimeReturn::Config(config)).unwrap();
}
Event::ExecuteFunction(f, args) => {
EventType::ExecuteFunction(f, args) => {
let value = unsafe { f.get_inner() }.get_value();
let value = handlers[value];
let mut scope = runtime.handle_scope();
@ -133,7 +134,7 @@ impl V8Runtime {
let result = result.map(|r| SerdeValue::from(r));
rtx.send(RuntimeReturn::OptionalValue(
result.map(|result| unsafe { V8Value::new(SerdeValue::from(result)) }),
result.map(|result| unsafe { V8Value::new(v8runtime.clone(), SerdeValue::from(result)) }),
))
.unwrap();
}
@ -251,7 +252,7 @@ impl ProviderCall for V8Function {
self.runtime
.lock()
.unwrap()
.call_event(Event::ExecuteFunction(
.call_event(EventType::ExecuteFunction(
self.clone(),
args.into_iter().map(|v| (*v).clone()).collect(),
));
@ -277,7 +278,7 @@ impl Provider for V8Runtime {
type InitData = V8Init;
fn init_config(&self, d: Self::InitData) -> Result<RunnerConfig<Self>, Self::Error> {
let result = self.call_event(Event::GetScriptConfig(d.code));
let result = self.call_event(EventType::GetScriptConfig(d.code));
let value = result.as_config().unwrap();
Ok(value)
}