Test case details

Preparation Code

<script> var global = this; (function() { global.obj = { _prop: 0 }; global.obj1 = { _prop: 0, getProp: function() { return this._prop; }, setProp: function(value) { this._prop = value; } }; global.obj2 = { _prop: 0, get prop() { return this._prop; }, set prop(value) { this._prop = value; } }; global.obj3 = { _prop: 0 } Object.defineProperty(global.obj3, "prop", { get: function() { return this._prop; }, set: function(val) { this._prop = val; } }); global.obj4 = { _prop: 0 } global.obj4.__defineGetter__("prop", function() { return this._prop; }); global.obj4.__defineSetter__("prop", function(val) { this._prop = val; }); })(); </script>

Test cases

Test #1

global.obj1.setProp(global.obj1.getProp() + 1);

Test #2

global.obj2.prop = global.obj2.prop + 1;

Test #3

global.obj3.prop = global.obj3.prop + 1;

Test #4

global.obj4.prop = global.obj4.prop + 1;

Test #5

global.obj.prop = global.obj.prop + 1;