summaryrefslogtreecommitdiffstats
path: root/js/src/tests/js1_8_5/extensions/regress-604781-2.js
blob: 7aba4a274d71d6bc509ad9fb545387f665a3a3c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/

var log;
function watcher(id, old, newval) { log += 'watcher'; return newval; }
var o = { set x(v) { log += 'setter'; } };
o.watch('x', watcher);
Object.defineProperty(o, 'x', {value: 3, writable: true});
log = '';
o.x = 3;
assertEq(log, 'watcher');

reportCompare(0, 0, 'ok');