public: publish selfhost snapshot to public repo (SSOT using + AST merge + JSON VM fixes)
- SSOT using profiles (aliases/packages via nyash.toml), AST prelude merge - Parser/member guards; Builder pin/PHI and instance→function rewrite (dev on) - VM refactors (handlers split) and JSON roundtrip/nested stabilization - CURRENT_TASK.md updated with scope and acceptance criteria Notes: dev-only guards remain togglable via env; no default behavior changes for prod.
This commit is contained in:
@ -136,6 +136,7 @@ impl MapBox {
|
||||
let key_str = key.to_string_box().value;
|
||||
match self.data.read().unwrap().get(&key_str) {
|
||||
Some(value) => {
|
||||
// Preserve identity for plugin/user InstanceBox to keep internal fields
|
||||
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
|
||||
if value
|
||||
.as_any()
|
||||
@ -144,6 +145,13 @@ impl MapBox {
|
||||
{
|
||||
return value.share_box();
|
||||
}
|
||||
if value
|
||||
.as_any()
|
||||
.downcast_ref::<crate::instance_v2::InstanceBox>()
|
||||
.is_some()
|
||||
{
|
||||
return value.share_box();
|
||||
}
|
||||
value.clone_box()
|
||||
}
|
||||
None => Box::new(StringBox::new(&format!("Key not found: {}", key_str))),
|
||||
@ -169,9 +177,11 @@ impl MapBox {
|
||||
|
||||
/// 全てのキーを取得
|
||||
pub fn keys(&self) -> Box<dyn NyashBox> {
|
||||
let keys: Vec<String> = self.data.read().unwrap().keys().cloned().collect();
|
||||
let mut keys: Vec<String> = self.data.read().unwrap().keys().cloned().collect();
|
||||
// Deterministic ordering for stable stringify/tests
|
||||
keys.sort();
|
||||
let array = ArrayBox::new();
|
||||
for key in keys {
|
||||
for key in keys.into_iter() {
|
||||
array.push(Box::new(StringBox::new(&key)));
|
||||
}
|
||||
Box::new(array)
|
||||
@ -184,7 +194,13 @@ impl MapBox {
|
||||
.read()
|
||||
.unwrap()
|
||||
.values()
|
||||
.map(|v| v.clone_box())
|
||||
.map(|v| {
|
||||
if v.as_any().downcast_ref::<crate::instance_v2::InstanceBox>().is_some() {
|
||||
v.share_box()
|
||||
} else {
|
||||
v.clone_box()
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
let array = ArrayBox::new();
|
||||
for value in values {
|
||||
|
||||
Reference in New Issue
Block a user