P0: user_defined factory safe init stub; P1: HTTPResponseBox interior mutability via Mutex (thread-safe), implement set_status/header/body/append_body + to_http_string, manual Clone; build green

This commit is contained in:
Selfhosting Dev
2025-09-19 11:23:56 +09:00
parent f64718d22a
commit 21d326333d
2 changed files with 76 additions and 75 deletions

View File

@ -38,14 +38,17 @@ impl BoxFactory for UserDefinedBoxFactory {
})?;
// Create InstanceBox with fields and methods
let instance = InstanceBox::from_declaration(
let mut instance = InstanceBox::from_declaration(
name.to_string(),
box_decl.fields.clone(),
box_decl.methods.clone(),
);
// TODO: Execute birth/init constructor with args
// For now, just return the instance
// Safe stub: run minimal init hook (no-op for now).
// - Does not execute user birth/init AST yet (interpreter-owned).
// - Avoids panics; ignores errors to keep factory safe.
let _ = instance.init(_args);
Ok(Box::new(instance))
}