blob: 6ae2ca1e53d5aa3a4a5927eafd68d27389b2c50a [file] [log] [blame]
function foo() {
function bar() {
this.x = 42;
}
bar.prototype = 50;
return new bar();
}
function assert(b) {
if (!b)
throw new Error("Bad");
}
let items = [
foo(),
foo(),
foo(),
foo(),
foo(),
foo(),
];
function validate(item) {
assert(item.notThere === undefined);
assert(item.x === 42);
assert(item.__proto__ === Object.prototype);
}
for (let i = 0; i < 10000; ++i) {
for (let item of items)
validate(item);
}