blob: fd0264d33b76b5ea35f58f13becd571e432c258f [file] [log] [blame]
let assert = {
sameValue: function (a, e) {
if (a !== e)
throw new Error("Expected: " + e + " but got: " + a);
}
}
let i = 0;
class C {
#field = this.init();
init() {
if (i >= 5000)
this.property = i;
return 'test';
}
setField(v) {
this.#field = v;
}
getField() {
return this.#field;
}
}
noInline(C.prototype.setField);
noInline(C.prototype.getField);
noDFG(C.prototype.getField);
noFTL(C.prototype.getField);
for (; i < 10000; i++) {
let c = new C();
assert.sameValue(c.getField(), 'test');
c.setField('foo' + i);
assert.sameValue(c.getField(), 'foo' + i);
}