blob: 884e589d4d0fc0e284d160bd47c36b4c3695dea1 [file] [log] [blame]
//@ requireOptions("--exposeCustomSettersOnGlobalObjectForTesting=true")
function assert(b) {
if (!b)
throw new Error;
}
let global = this;
Object.defineProperty(global, "Y", {
set: function(v) {
assert(this === global);
assert(v === i + 1);
this._Y = v;
}
});
function foo(x, y, z, a) {
this.X = x;
this.Y = y;
this.testCustomAccessorSetter = z;
this.testCustomValueSetter = a;
}
noInline(foo);
let i;
for (i = 0; i < 1000000; ++i) {
foo(i, i + 1, i + 2, i + 3);
assert(global.X === i);
assert(global._Y === i + 1);
assert(global._testCustomAccessorSetter === i + 2);
assert(global._testCustomValueSetter === i + 3);
}