fix(runtime): align Web Storage accessors#4343
Closed
andrewtdiz wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Closing this duplicate in favor of #4341, which covers the same Web Storage accessor slice and has the fuller internal length-slot fix plus focused parity validation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
localStorageandsessionStorageaccessor getters return their canonical storage objects instead ofundefined.Storage.prototype.lengthgetter from the global storage getter so it returns the current storage length for storage receivers and throwsIllegal invocationfor incompatible receivers.globals/storage-globalsparity fixture to cover storage getter identity andStorage.prototype.lengthinvocation behavior.Root Cause
The runtime installed reflectable Web Storage accessor descriptors, but reused a no-op getter thunk. Descriptor getter calls therefore returned
undefined, and the prototypelengthgetter did not enforce Node's receiver behavior.Validation
NODE26_BIN=$(npm exec --yes --package=node@26 -- node -e 'console.log(process.execPath)') && "$NODE26_BIN" --experimental-strip-types --experimental-webstorage --localstorage-file=/tmp/perry_web_storage_parity.sqlite test-parity/node-suite/globals/storage-globals.tsCARGO_TARGET_DIR=/root/perry-worktrees/.build-targets/storage-globals-check RUSTC_WRAPPER= CARGO_BUILD_JOBS=1 cargo check -q -j1 -p perry-runtimecargo fmt --all -- --checkgit diff --check./scripts/check_file_size.shRefs #812.