Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11694-fix-main-reds-class-id-sloppy-this.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix two reds on `main`, both test-only. (1) Renamed the test-local `CLASS_ID` in `perry-runtime/src/object/static_shapes_tests.rs` (from #11678) to `LATE_POOL_CLASS_ID`. `scripts/class_id_collisions.py` no longer reports it as a drifted mirror of `class_registry/state.rs`'s `CLASS_ID`, and the audit itself is unchanged (#11691). (2) Moved `test_gap_sloppy_this_bound_once` from `.ts` to `.cts`. Under the repo's `"type": "module"`, Node ran the `.ts` as strict ESM and the oracle threw on `mutate.call(1)`. A `.cts` is sloppy CommonJS in both runtimes, and Perry's output now matches Node 26.5.1 byte for byte (#11693).
13 changes: 8 additions & 5 deletions crates/perry-runtime/src/object/static_shapes_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,15 @@ fn a_seeded_literal_shape_answers_the_megamorphic_confirm_like_a_minted_one() {
/// class's confirms fail.
#[test]
fn a_class_registered_before_the_pools_answers_the_megamorphic_confirm() {
const CLASS_ID: u32 = 0x0074_1c77;
const LATE_POOL_CLASS_ID: u32 = 0x0074_1c77;
let packed = b"ltca_x\0ltca_only_in_b\0";
let keys =
crate::object::js_build_class_keys_array(CLASS_ID, 2, packed.as_ptr(), packed.len() as u32)
as u64;
let id = shapes::js_object_shape_id_for_class_keys(keys, 2, CLASS_ID);
let keys = crate::object::js_build_class_keys_array(
LATE_POOL_CLASS_ID,
2,
packed.as_ptr(),
packed.len() as u32,
) as u64;
let id = shapes::js_object_shape_id_for_class_keys(keys, 2, LATE_POOL_CLASS_ID);
// Module B's pool runs afterwards and mints its key literals.
let (x, b) = (pool_atom("ltca_x"), pool_atom("ltca_only_in_b"));
assert!(
Expand Down
Loading