diff --git a/crates/oxide_bytecode/src/module.rs b/crates/oxide_bytecode/src/module.rs index ac4cd0ea..827d7eb9 100644 --- a/crates/oxide_bytecode/src/module.rs +++ b/crates/oxide_bytecode/src/module.rs @@ -22,13 +22,13 @@ pub struct CompiledModule { pub param_base: u8, pub builtin_reg_map: Vec<(String, u8)>, pub sub_modules: Vec, - /// True when this module is an arrow function body (D-01). + /// True when this module is an arrow function body. /// Arrow functions capture lexical `this` from the enclosing scope. pub is_arrow: bool, /// Index into `constants` holding the captured `this` JsValue. /// 0 means "not captured - use standard this binding". pub captured_this_const_idx: u16, - /// Function name inferred from assignment context (D-04). + /// Function name inferred from assignment context. /// Set at the VariableDeclaration / ObjectProperty assignment site. pub function_name: Option, /// True when this bytecode function is a class constructor. diff --git a/crates/oxide_compiler/src/compiler.rs b/crates/oxide_compiler/src/compiler.rs index 0ba1167a..2563251b 100644 --- a/crates/oxide_compiler/src/compiler.rs +++ b/crates/oxide_compiler/src/compiler.rs @@ -159,7 +159,7 @@ pub(crate) struct CompileCtx { pub(crate) builtin_reg_map: Vec<(String, u8)>, pub(crate) sub_modules: Vec, /// Register holding `this` in the enclosing function context. - /// Used by arrow functions to capture lexical `this` (D-01). + /// Used by arrow functions to capture lexical `this`. /// Initialized to 254 (conventional this register) at the top level. pub(crate) enclosing_this_reg: u8, pub(crate) in_derived_constructor: bool, diff --git a/crates/oxide_compiler/src/emitter/expr/function.rs b/crates/oxide_compiler/src/emitter/expr/function.rs index 681c0a4a..d8773ecd 100644 --- a/crates/oxide_compiler/src/emitter/expr/function.rs +++ b/crates/oxide_compiler/src/emitter/expr/function.rs @@ -4,7 +4,7 @@ impl Compiler { pub(in crate::emitter) fn emit_arrow_function_expression( &self, arrow: &oxide_parser::ArrowFunctionExpression, ctx: &mut CompileCtx, ) -> Result { - // Rest params not yet supported (D-06 placeholder) + // Rest params not yet supported if let Some(_rest) = &arrow.params.rest { return Err("rest params in arrow functions not yet supported".into()); } diff --git a/crates/oxide_compiler/src/emitter/expr/object.rs b/crates/oxide_compiler/src/emitter/expr/object.rs index 96d6ee83..e8792f07 100644 --- a/crates/oxide_compiler/src/emitter/expr/object.rs +++ b/crates/oxide_compiler/src/emitter/expr/object.rs @@ -38,7 +38,7 @@ impl Compiler { let key_reg = ctx.alloc_reg(); ctx.emit_load_const(key_reg, idx); let val_reg = self.emit_expression(&p.value, ctx)?; - // Name inference (D-04): if property value is an arrow function, + // Name inference: if property value is an arrow function, // set the compiled sub_module's function_name to the property key. if matches!(&p.value, Expression::ArrowFunctionExpression(_)) { if let Some(sub_mod) = ctx.sub_modules.last_mut() { diff --git a/crates/oxide_compiler/tests/arrow_template_tests.rs b/crates/oxide_compiler/tests/arrow_template_tests.rs index 5480a331..532af265 100644 --- a/crates/oxide_compiler/tests/arrow_template_tests.rs +++ b/crates/oxide_compiler/tests/arrow_template_tests.rs @@ -76,7 +76,7 @@ fn compile_arrow_name_inference() { .sub_modules .iter() .any(|m| m.is_arrow && m.function_name.as_deref() == Some("myArrow")); - assert!(named, "arrow function should have function_name='myArrow' from D-04 inference"); + assert!(named, "arrow function should have function_name='myArrow' from name inference"); } #[test] diff --git a/crates/oxide_types/src/mem.rs b/crates/oxide_types/src/mem.rs index 2ad779d1..0f46a5f0 100644 --- a/crates/oxide_types/src/mem.rs +++ b/crates/oxide_types/src/mem.rs @@ -53,9 +53,9 @@ impl fmt::Display for P { /// Persistent heap for cross-epoch object storage. /// -/// Phase 3 provides a minimal API: `promote(value)` moves `value` to the -/// global heap under `Arc` and returns `P`. Phase 7 (OxideKernel) expands -/// with typed storage for shapes, code, IC templates, and strings. +/// Provides a minimal API: `promote(value)` moves `value` to the +/// global heap under `Arc` and returns `P`. Typed storage for shapes, +/// code, IC templates, and strings lives in the OxideKernel. pub struct PersistentHeap; impl PersistentHeap { diff --git a/crates/oxide_vm/src/builtins/stubs.rs b/crates/oxide_vm/src/builtins/stubs.rs index 1f985c5d..3769ae84 100644 --- a/crates/oxide_vm/src/builtins/stubs.rs +++ b/crates/oxide_vm/src/builtins/stubs.rs @@ -5,7 +5,7 @@ fn stub_error(vm: &mut Vm, name: &str) -> NativeResult { NativeResult::Err(crate::builtins::error::create_type_error(vm, &format!("{name} is not implemented"))) } -// Architecturally deferred — see 13.5-CONTEXT.md for rationale +// Architecturally deferred — these features are excluded from the supported language subset by design. pub fn proxy_stub(vm: &mut Vm, _args: &[u8]) -> NativeResult { stub_error(vm, "Proxy") } diff --git a/crates/oxide_vm/src/vm_support.rs b/crates/oxide_vm/src/vm_support.rs index a74c66c9..ad575273 100644 --- a/crates/oxide_vm/src/vm_support.rs +++ b/crates/oxide_vm/src/vm_support.rs @@ -202,7 +202,7 @@ impl Vm { /// Create a function JsObject for a BytecodeFunc constant. /// When `is_arrow` is true, captures the current `this` (regs[254]) - /// for lexical this binding at call time (D-01). + /// for lexical this binding at call time. fn create_function_object( &mut self, sub_idx: u32, is_arrow: bool, is_class_constructor: bool, is_derived_constructor: bool, needs_home_object: bool,