haikuwebkit/JSTests/microbenchmarks/setter.js

12 lines
326 B
JavaScript

//@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py
(function() {
var o = {_f:42};
o.__defineSetter__("f", function(value) { this._f = value; });
var n = 2000000;
for (var i = 0; i < n; ++i)
o.f = i;
if (o._f != n - 1)
throw "Error: bad result: " + o._f;
})();