Skip to content

Conversation

gibson042
Copy link
Contributor

@gibson042 gibson042 commented Jul 18, 2025

Ref #4509

New ArrayBuffer.prototype properties

  • ArrayBuffer.prototype.immutable
    • getter-only accessor, enumerable false and configurable true
    • name "get immutable" and length 0
    • brand-checking (throws TypeError unless receiver is an ArrayBuffer and not a SharedArrayBuffer)
    • returns true for an immutable receiver and false for a non-immutable one
    • does not throw for a detached receiver

@gibson042 gibson042 requested review from a team as code owners July 18, 2025 16:52
@gibson042 gibson042 force-pushed the 2025-07-immutable-arraybuffer-arraybuffer-prototype-immutable branch 2 times, most recently from d334aad to 4f01207 Compare July 18, 2025 19:26
@gibson042 gibson042 force-pushed the 2025-07-immutable-arraybuffer-arraybuffer-prototype-immutable branch from 4f01207 to c722f14 Compare July 18, 2025 19:31
Copy link
Contributor

@Ms2ger Ms2ger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines 28 to 31
var isHardened = Object.isFrozen(Object);
if (isHardened && desc.get) {
Object.defineProperty(desc, "get", { configurable: false });
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be in individual tests, if we support it at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on defineProperty (and removed), but varying the configurable assumption is pretty much necessary to avoid excessive work in a hardened environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants