window.onload = function(){ var iframe = document.createElement('iframe'); iframe.src = 'javascript: true'; //ie init frame document.body.appendChild(iframe); iframe.onreadystatechange = function(){ if(iframe.readyState == 'complete'){ var F = iframe.contentWindow.Function F.prototype.valueOf = function(){ return this(); } var myObj = { one: new F('return 1;') } alert(myObj.one + 2); } } }