Repository navigation
Conversation
The freeze guard now throws only when array_buffer_is_resizable is true, and a detached fixed-length view continues through the normal freeze path and is returned. Views of resizable buffers are still rejected with the same TypeError. tests/bug1765.js covers freeze of detached Float32Array and Uint8Array views, freezing a named own property after detach, the existing invalid descriptor flags failure for an in-bounds view, length-tracking and fixed-length views of resizable buffers, Object.seal on a detached view, and freeze of an ordinary object. Fixes quickjs-ng#1765
This branch has not been deployed
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.
The freeze guard now throws only when array_buffer_is_resizable is true, and a detached fixed-length view continues through the normal freeze path and is returned. Views of resizable buffers are still rejected with the same TypeError. Object.freeze throws TypeError: cannot freeze resizable typed array on a fixed-length typed array after its ArrayBuffer is detached, for example by transfer(). The view has no indexed elements and its buffer is not resizable, so freeze should return the same object.
Tests for this live in
tests/bug1765.js.Fixes #1765