1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_8_5/extensions/regress-627984-1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +// Any copyright is dedicated to the Public Domain. 1.5 +// http://creativecommons.org/licenses/publicdomain/ 1.6 + 1.7 +// See bug 627984, comment 17, item 1. 1.8 +var obj; 1.9 +var methods = []; 1.10 +for (var i = 0; i < 2; i++) { 1.11 + obj = {m: function () { return this.x; }}; 1.12 + obj.watch("m", function (id, oldval, newval) { methods[i] = oldval; }); 1.13 + obj.m = 0; 1.14 +} 1.15 +assertEq(typeof methods[0], "function"); 1.16 +assertEq(typeof methods[1], "function"); 1.17 +assertEq(methods[0] !== methods[1], true); 1.18 + 1.19 +reportCompare(0, 0, 'ok');