{"size": 989, "ext": "js", "max_stars_repo_path": "js-test-suite/testsuite/bf894198be8774e8e34efe3c292d0d10.js", "max_stars_repo_name": "hao-wang/Montage", "max_stars_repo_stars_event_min_datetime": "2020-03-23T12:53:10.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-11T02:31:50.000Z", "max_issues_repo_path": "js-test-suite/testsuite/bf894198be8774e8e34efe3c292d0d10.js", "max_issues_repo_name": "hao-wang/Montage", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js-test-suite/testsuite/bf894198be8774e8e34efe3c292d0d10.js", "max_forks_repo_name": "hao-wang/Montage", "max_forks_repo_forks_event_min_datetime": "2020-08-17T14:06:59.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-17T14:06:59.000Z"}
{"max_stars_count": 16, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 19.3921568627, "max_line_length": 143, "alphanum_fraction": 0.6440849343}
load("e2371540d876710daf38e749390aa2a3.js");
description("Tests wrappers for ArrayBuffer objects are not GCed when they shouldn't be");

let types = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, DataView];

debug("Test subclassing");

types.forEach(function(type) {
    C = class extends ArrayBuffer { }

    let b = new C(8);
    foo = new type(b);

    b = null;
    gc();

    shouldBeTrue("foo.buffer instanceof C");
});

debug("");
debug("Test properties");

types.forEach(function(type) {
    b = new ArrayBuffer(8);
    b.bar = 1;

    foo = new Int32Array(b);
    b = null;
    gc();

    shouldBe("foo.buffer.bar", "1");
});

debug("");
debug("Test WeakMap");

types.forEach(function(type) {
    ws = new WeakSet();
    b = new ArrayBuffer(8);

    ws.add(b);
    foo = new Int32Array(b);
    b = null;

    gc();

    shouldBeTrue("ws.has(foo.buffer)");
});

load("cf1a0efae1078faee510f7bda78d4902.js");
