diff options
Diffstat (limited to 'deps/v8/test/message/fail/json-stringify-circular-ellipsis.js')
-rw-r--r-- | deps/v8/test/message/fail/json-stringify-circular-ellipsis.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/deps/v8/test/message/fail/json-stringify-circular-ellipsis.js b/deps/v8/test/message/fail/json-stringify-circular-ellipsis.js new file mode 100644 index 0000000000..30f3e6e9e8 --- /dev/null +++ b/deps/v8/test/message/fail/json-stringify-circular-ellipsis.js @@ -0,0 +1,27 @@ +// Copyright 2019 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. + +class Outer { + constructor(o) { this.x = o; } +} + +class Inner { + constructor(o) { this.y = o; } +} + +class ArrayHolder { + constructor(o) { + this.array = []; + this.array[1] = o; + } +} + +const root = {}; +root.first = new Outer( + new ArrayHolder( + new Inner(root) + ) +); + +JSON.stringify(root); |