summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/shared-memory/private-name.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/shared-memory/private-name.js')
-rw-r--r--deps/v8/test/mjsunit/shared-memory/private-name.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/shared-memory/private-name.js b/deps/v8/test/mjsunit/shared-memory/private-name.js
new file mode 100644
index 0000000000..a2e2f0caae
--- /dev/null
+++ b/deps/v8/test/mjsunit/shared-memory/private-name.js
@@ -0,0 +1,13 @@
+// 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)));