2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
7 function watcher(p,o,n) { hitCount++; return n; }
10 a.watch('length', watcher);
13 reportCompare(1, hitCount, "lenient; configurable: watchpoint hit");
15 var b = Object.defineProperty([1],'0',{configurable:false});
16 b.watch('length', watcher);
23 result = x.toString();
25 reportCompare(1, hitCount, "lenient; non-configurable: watchpoint hit");
26 reportCompare(1, b.length, "lenient; non-configurable: length unchanged");
27 reportCompare("no error", result, "lenient; non-configurable: no error thrown");
29 var c = Object.defineProperty([1],'0',{configurable:false});
30 c.watch('length', watcher);
34 (function(){'use strict'; c.length = 0;})();
35 threwTypeError = false;
37 threwTypeError = x instanceof TypeError;
39 reportCompare(1, hitCount, "strict; non-configurable: watchpoint hit");
40 reportCompare(1, c.length, "strict; non-configurable: length unchanged");
41 reportCompare(true, threwTypeError, "strict; non-configurable: TypeError thrown");