js/src/jit-test/tests/basic/testBug659577-2.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/basic/testBug659577-2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +gczeal(4);
     1.5 +evaluate("\
     1.6 +Date.formatFunctions = {count:0};\
     1.7 +Date.prototype.dateFormat = function(format) {\
     1.8 +    var funcName = 'format' + Date.formatFunctions.count++;\
     1.9 +    var code = 'Date.prototype.' + funcName + ' = function(){return ';\
    1.10 +    var ch = '';\
    1.11 +    for (var i = 0; i < format.length; ++i) {\
    1.12 +        ch = format.charAt(i);\
    1.13 +        eval(code.substring(0, code.length - 3) + ';}');\
    1.14 +    }\
    1.15 +};\
    1.16 +var date = new Date('1/1/2007 1:11:11');\
    1.17 +    var shortFormat = date.dateFormat('Y-m-d');\
    1.18 +");

mercurial