Date.toLocaleString() generates uncaught exception

RESOLVED WORKSFORME

Status

()

Core
JavaScript Engine
RESOLVED WORKSFORME
15 years ago
14 years ago

People

(Reporter: Ryuichi KUBUKI, Unassigned)

Tracking

({regression})

Trunk
x86
Windows XP
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6a) Gecko/20031025
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6a) Gecko/20031025

This simple script generates "Error: uncaught exception: null" in Javascript
console, at toLocaleString(). It's regression.

<html>
<body>

Unix time 1067094850 is:
<script language="JavaScript">

function getDate(t)
{
	var d = new Date;
	d.setTime(t * 1000);
	return d.toLocaleString();
}

document.write(getDate(1067094850));

</script>

</body>
</html>

Reproducible: Always

Steps to Reproduce:



Expected Results:  
toLocaleString() shows platform/locale-dependent date string.

Updated

15 years ago
Keywords: regression

Comment 1

15 years ago
Created attachment 134130 [details]
Testcase

Comment 2

15 years ago
WFM using a recent CVS build on Linux.

Comment 3

14 years ago
The script worksforme in the current optimized JS shell on Win2K:

js> function getDate(t)
{
    var d = new Date;
    d.setTime(t * 1000);
    return d.toLocaleString();
}

js> print(getDate(1067094850));
Saturday, October 25, 2003 08:14:10

js> print(getDate(1067094850));
Saturday, October 25, 2003 08:14:10

js> print(getDate(1067094850));
Saturday, October 25, 2003 08:14:10



Note, a fix for Date.prototype.toLocaleString() was just recently checked in:
see bug 153586, "Date.prototype.toLocaleString() not implemented correctly"

Cc'ing folks from that bug. 

kl@cosmos-21.com (KL): what locale settings are you using?
(Reporter)

Comment 4

14 years ago
Comment #3:

My locale is Japanese, on Windows XP obviously.

Comment 5

14 years ago
WFM BuildId 2003102323 on Red Hat Linux, LANG=ru_RU.UTF-8.

Comment 6

14 years ago
I successfully reproduced this bug with Mozilla/5.0 (Windows; U; Windows NT 5.0;
en-US; rv:1.6a) Gecko/20031026 Firebird/0.7+.

1)  Tools | JavaScript Console
2)  Open testcase URL

Comment 7

14 years ago
Patch of bug 153586 has been backed out to allow a 1.6a release
while the problems of toLocaleString on non-unix style platforms
are investigated.
(Reporter)

Comment 8

14 years ago
Works again in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6a)
Gecko/20031029 Firebird/0.7+, possibly because of backing out.
But this time I got different string from before regression (I had got string
with Japanese characters, but it's all in English now, though not significant
change)

Comment 9

14 years ago
Based on KL's findings, resolving this bug as WORKSFORME.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.