Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions SunSpider/date-format-tofte.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},

Expand All @@ -86,25 +86,25 @@ 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();
}
},

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();
},

Expand Down Expand Up @@ -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();
},

Expand Down
2 changes: 1 addition & 1 deletion SunSpider/date-format-xparb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = " ";
}
Expand Down
12 changes: 6 additions & 6 deletions worker/bomb-subtests/date-format-tofte.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion worker/bomb-subtests/date-format-xparb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = " ";
}
Expand Down
Loading