v8/test/mjsunit/shared-memory/private-name.js
Shu-yu Guo f4cba668d9 [shared-struct] Disallow adding private named properties to shared objects
Bug: chromium:1393227
Change-Id: I5b8ad2e9c6898d5ef9bbf47572380492745c415a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4062670
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84572}
2022-11-30 13:26:42 +00:00

14 lines
612 B
JavaScript

// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-struct
// Private names as used by V8-specific APIs like Error.captureStackTrace should
// not bypass shared objects' extensibility check.
assertThrows(() => Error.captureStackTrace(new Atomics.Condition()));
assertThrows(() => Error.captureStackTrace(new Atomics.Mutex()));
assertThrows(() => Error.captureStackTrace(new (new SharedStructType(['p']))));
assertThrows(() => Error.captureStackTrace(new SharedArray(1)));