From a1a2d89e4553618e3300d60384d93993e05e4974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Wed, 2 Sep 2026 07:23:56 +0200 Subject: [PATCH 1/2] test(9249): opt the blocked-store case into strict mode (#9426 semantics) --- .../issue_9249_array_prototype_define_property.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/perry/tests/issue_9249_array_prototype_define_property.rs b/crates/perry/tests/issue_9249_array_prototype_define_property.rs index 7abc78182f..9aa254290d 100644 --- a/crates/perry/tests/issue_9249_array_prototype_define_property.rs +++ b/crates/perry/tests/issue_9249_array_prototype_define_property.rs @@ -111,7 +111,15 @@ console.log(hits, values.length, values[5]); #[test] fn reflect_define_property_non_writable_prototype_index_blocks_array_store() { compile_and_run( - r#" + r#""use strict"; +// #9426 made a rejected array-element write throw ONLY in strict mode, which +// is what node does. This file is a bare .ts — the oracle +// (`node --experimental-strip-types`) runs it as a SCRIPT, i.e. sloppy, where +// the rejected store silently no-ops in node too: +// $ node --experimental-strip-types +// no error 1 P +// The point of this test is that a non-writable inherited index BLOCKS the +// store, so it opts into strict mode rather than asserting the sloppy no-op. Reflect.defineProperty(Array.prototype, 11, { value: "P", writable: false, From a6e2a1d01f3c838fa62092bdb04eae8880e57021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Wed, 2 Sep 2026 07:50:03 +0200 Subject: [PATCH 2/2] docs(changelog): fragment for the #9249 strict-mode test fix --- changelog.d/9481-9249-strict-mode-store.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 changelog.d/9481-9249-strict-mode-store.md diff --git a/changelog.d/9481-9249-strict-mode-store.md b/changelog.d/9481-9249-strict-mode-store.md new file mode 100644 index 0000000000..da6be8d5f5 --- /dev/null +++ b/changelog.d/9481-9249-strict-mode-store.md @@ -0,0 +1,16 @@ +**test(9249): opt the blocked-store case into strict mode (#9426 semantics)** + +`reflect_define_property_non_writable_prototype_index_blocks_array_store` +asserted a `TypeError` from a sloppy-mode script. #9426 made a rejected +array-element write throw **only in strict mode** — which matches node: + +| | output | +|---|---| +| Perry, with `"use strict"` | `TypeError 1 P` | +| Perry, as written (script) | `no error 1 P` | +| `node --experimental-strip-types`, same `.ts` | `no error 1 P` | + +Perry and node agree exactly, so the code is right and the expectation was +stale. The test's purpose — a non-writable inherited index BLOCKS the store — +is still worth keeping, so it opts into strict mode rather than weakening the +assertion to the sloppy no-op.