bug1448582-3.js (704B)
1 // Overview: 2 // - The outer function is an IIFE which gets marked as a singleton. 3 // - The |fn| inner function is then also marked as a singleton. 4 // - The |self| inner function uses |Function.prototype.caller| to reinvoke the outer function. 5 // 6 // When we reinvoke outer, we end up cloning a previously reused, i.e. non-cloned, 7 // function. 8 9 (function(index) { 10 var fn = function() {}; 11 12 // Accessing |.name| sets the resolved-name flag, which should not be 13 // copied over to the function clone. 14 assertEq(fn.name, "fn"); 15 16 // Reinvoke the IIFE through |Function.prototype.caller|. 17 if (index === 0) { 18 (function self() { 19 self.caller(1); 20 })(); 21 } 22 })(0);