diff --git a/changelog.d/11694-fix-main-reds-class-id-sloppy-this.md b/changelog.d/11694-fix-main-reds-class-id-sloppy-this.md new file mode 100644 index 0000000000..6de1f79df3 --- /dev/null +++ b/changelog.d/11694-fix-main-reds-class-id-sloppy-this.md @@ -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). diff --git a/crates/perry-runtime/src/object/static_shapes_tests.rs b/crates/perry-runtime/src/object/static_shapes_tests.rs index 7b169478e2..a21065eab3 100644 --- a/crates/perry-runtime/src/object/static_shapes_tests.rs +++ b/crates/perry-runtime/src/object/static_shapes_tests.rs @@ -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!( diff --git a/test-files/test_gap_sloppy_this_bound_once.ts b/test-files/test_gap_sloppy_this_bound_once.cts similarity index 100% rename from test-files/test_gap_sloppy_this_bound_once.ts rename to test-files/test_gap_sloppy_this_bound_once.cts