From: mjs Date: Tue, 30 Oct 2007 01:37:42 +0000 (+0000) Subject: Reviewed by Darin. X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=799483406e297ae1f93bc00d19374fb034a760a5;ds=sidebyside Reviewed by Darin. - fix Date tests to work in command-line SpiderMonkey * tests/date-format-tofte.js: * tests/date-format-xparb.js: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27243 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/SunSpider/ChangeLog b/SunSpider/ChangeLog index 5e98ad58bdbd..be306fb3e2d2 100644 --- a/SunSpider/ChangeLog +++ b/SunSpider/ChangeLog @@ -1,3 +1,12 @@ +2007-10-29 Maciej Stachowiak + + Reviewed by Darin. + + - fix Date tests to work in command-line SpiderMonkey + + * tests/date-format-tofte.js: + * tests/date-format-xparb.js: + 2007-10-29 Darin Adler Reviewed by Maciej. diff --git a/SunSpider/tests/date-format-tofte.js b/SunSpider/tests/date-format-tofte.js index 203783f1a8e4..66e2cef8757e 100644 --- a/SunSpider/tests/date-format-tofte.js +++ b/SunSpider/tests/date-format-tofte.js @@ -1,6 +1,6 @@ -Array.prototype.exists = function (x) { - for (var i = 0; i < this.length; i++) { - if (this[i] == x) return true; +function arrayExists(array, x) { + for (var i = 0; i < array.length; i++) { + if (array[i] == x) return true; } return false; } @@ -276,7 +276,7 @@ Date.prototype.formatDate = function (input,time) { // this is our way of allowing users to escape stuff ia.splice(ij,1); } else { - if (switches.exists(ia[ij])) { + if (arrayExists(switches,ia[ij])) { ia[ij] = eval(ia[ij] + "()"); } } @@ -292,8 +292,8 @@ Date.prototype.formatDate = function (input,time) { var date = new Date("1/1/2007 1:11:11"); for (i = 0; i < 500; ++i) { - var short = date.formatDate("Y-m-d"); - var long = date.formatDate("l, F d, Y g:i:s A"); + var shortFormat = date.formatDate("Y-m-d"); + var longFormat = date.formatDate("l, F d, Y g:i:s A"); date.setTime(date.getTime() + 84266956); } diff --git a/SunSpider/tests/date-format-xparb.js b/SunSpider/tests/date-format-xparb.js index bc0afe5ca698..1f0955649ed7 100644 --- a/SunSpider/tests/date-format-xparb.js +++ b/SunSpider/tests/date-format-xparb.js @@ -411,7 +411,7 @@ Date.patterns = { var date = new Date("1/1/2007 1:11:11"); for (i = 0; i < 4000; ++i) { - var short = date.dateFormat("Y-m-d"); - var long = date.dateFormat("l, F d, Y g:i:s A"); + var shortFormat = date.dateFormat("Y-m-d"); + var longFormat = date.dateFormat("l, F d, Y g:i:s A"); date.setTime(date.getTime() + 84266956); }