regress-4027.js 1009 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
// Copyright 2015 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: --allow-natives-syntax --expose-gc

function Inner() {
  this.inner_name = "inner";
}

function Boom() {
  this.boom = "boom";
}

function Outer() {
  this.outer_name = "outer";
}

function SetInner(inner, value) {
  inner.prop = value;
}

function SetOuter(outer, value) {
  outer.inner = value;
}

var inner1 = new Inner();
var inner2 = new Inner();

SetInner(inner1, 10);
SetInner(inner2, 10);

var outer1 = new Outer();
var outer2 = new Outer();
var outer3 = new Outer();

SetOuter(outer1, inner1);
SetOuter(outer1, inner1);
SetOuter(outer1, inner1);

SetOuter(outer2, inner2);
SetOuter(outer2, inner2);
SetOuter(outer2, inner2);

SetOuter(outer3, inner2);
SetOuter(outer3, inner2);
SetOuter(outer3, inner2);


SetInner(inner2, 6.5);

outer1 = null;
inner1 = null;

gc();

var boom = new Boom();
SetOuter(outer2, boom);

gc();