diff --git a/SunSpider/date-format-tofte.js b/SunSpider/date-format-tofte.js index b2b1f816..4c4f22de 100644 --- a/SunSpider/date-format-tofte.js +++ b/SunSpider/date-format-tofte.js @@ -59,7 +59,7 @@ Date.prototype.formatDate = function (input,time) { d() { // Day of the month, 2 digits with leading zeros - return new String(self.getDate()).length == 1? + return String(self.getDate()).length == 1? "0"+self.getDate() : self.getDate(); }, @@ -86,11 +86,11 @@ Date.prototype.formatDate = function (input,time) { h() { // 12-hour format of an hour with leading zeros if (self.getHours() > 12) { - var s = new String(self.getHours()-12); + var s = String(self.getHours()-12); return s.length == 1? "0"+ (self.getHours()-12) : self.getHours()-12; } else { - var s = new String(self.getHours()); + var s = String(self.getHours()); return s.length == 1? "0"+self.getHours() : self.getHours(); } @@ -98,13 +98,13 @@ Date.prototype.formatDate = function (input,time) { H() { // 24-hour format of an hour with leading zeros - return new String(self.getHours()).length == 1? + return String(self.getHours()).length == 1? "0"+self.getHours() : self.getHours(); }, i() { // Minutes with leading zeros - return new String(self.getMinutes()).length == 1? + return String(self.getMinutes()).length == 1? "0"+self.getMinutes() : self.getMinutes(); }, @@ -176,7 +176,7 @@ Date.prototype.formatDate = function (input,time) { s() { // Seconds, with leading zeros - return new String(self.getSeconds()).length == 1? + return String(self.getSeconds()).length == 1? "0"+self.getSeconds() : self.getSeconds(); }, diff --git a/SunSpider/date-format-xparb.js b/SunSpider/date-format-xparb.js index 83cc6af2..f5e54539 100644 --- a/SunSpider/date-format-xparb.js +++ b/SunSpider/date-format-xparb.js @@ -349,7 +349,7 @@ String.escape = function(string) { } String.leftPad = function (val, size, ch) { - var result = new String(val); + var result = String(val); if (ch == null) { ch = " "; } diff --git a/worker/bomb-subtests/date-format-tofte.js b/worker/bomb-subtests/date-format-tofte.js index 6c2077c2..441b4c95 100644 --- a/worker/bomb-subtests/date-format-tofte.js +++ b/worker/bomb-subtests/date-format-tofte.js @@ -69,7 +69,7 @@ Date.prototype.formatDate = function (input,time) { function d() { // Day of the month, 2 digits with leading zeros - return new String(self.getDate()).length == 1? + return String(self.getDate()).length == 1? "0"+self.getDate() : self.getDate(); } function D() { @@ -91,23 +91,23 @@ Date.prototype.formatDate = function (input,time) { function h() { // 12-hour format of an hour with leading zeros if (self.getHours() > 12) { - var s = new String(self.getHours()-12); + var s = String(self.getHours()-12); return s.length == 1? "0"+ (self.getHours()-12) : self.getHours()-12; } else { - var s = new String(self.getHours()); + var s = String(self.getHours()); return s.length == 1? "0"+self.getHours() : self.getHours(); } } function H() { // 24-hour format of an hour with leading zeros - return new String(self.getHours()).length == 1? + return String(self.getHours()).length == 1? "0"+self.getHours() : self.getHours(); } function i() { // Minutes with leading zeros - return new String(self.getMinutes()).length == 1? + return String(self.getMinutes()).length == 1? "0"+self.getMinutes() : self.getMinutes(); } function j() { @@ -169,7 +169,7 @@ Date.prototype.formatDate = function (input,time) { } function s() { // Seconds, with leading zeros - return new String(self.getSeconds()).length == 1? + return String(self.getSeconds()).length == 1? "0"+self.getSeconds() : self.getSeconds(); } function t() { diff --git a/worker/bomb-subtests/date-format-xparb.js b/worker/bomb-subtests/date-format-xparb.js index 3bf82102..ec0d7edc 100644 --- a/worker/bomb-subtests/date-format-xparb.js +++ b/worker/bomb-subtests/date-format-xparb.js @@ -349,7 +349,7 @@ String.escape = function(string) { } String.leftPad = function (val, size, ch) { - var result = new String(val); + var result = String(val); if (ch == null) { ch = " "; }